Skip to content

Commit 8ff01f2

Browse files
fix: update e2e expected test data for CI compatibility
- Fix file mode 100755->100644 in diff.patch files for condition-met, condition-not-met, basicpipeline-symlink, fnconfig-updated-in-render - Fix diff hunk format to incremental (not full file replacement) - Remove symlink entry from basicpipeline-symlink expected diff (symlink is deleted by exec.sh before diff runs) - Add apiVersion: v1 to apply-replacements source selector in fnconfig-updated-in-render/update-labels.yaml (v0.1.5 now requires it) - Add .gitattributes to enforce LF line endings for patch/yaml/go files
1 parent 0457465 commit 8ff01f2

6 files changed

Lines changed: 266 additions & 161 deletions

File tree

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Ensure consistent LF line endings for test data files
2+
*.patch text eol=lf
3+
*.yaml text eol=lf
4+
*.yml text eol=lf
5+
*.sh text eol=lf
6+
*.go text eol=lf
7+
*.md text eol=lf
Lines changed: 59 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,59 @@
1-
diff --git a/new-link b/new-link
2-
new file mode 120000
3-
index 0000000..6a04314
4-
--- /dev/null
5-
+++ b/new-link
6-
@@ -0,0 +1 @@
7-
+./
8-
\ No newline at end of file
1+
diff --git a/Kptfile b/Kptfile
2+
index 1307fb5..fee64dc 100644
3+
--- a/Kptfile
4+
+++ b/Kptfile
5+
@@ -2,6 +2,9 @@ apiVersion: kpt.dev/v1
6+
kind: Kptfile
7+
metadata:
8+
name: app
9+
+ namespace: staging
10+
+ labels:
11+
+ tier: backend
12+
pipeline:
13+
mutators:
14+
- image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
15+
@@ -10,3 +13,14 @@ pipeline:
16+
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
17+
configMap:
18+
tier: backend
19+
+status:
20+
+ conditions:
21+
+ - type: Rendered
22+
+ status: "True"
23+
+ reason: RenderSuccess
24+
+ renderStatus:
25+
+ mutationSteps:
26+
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
27+
+ exitCode: 0
28+
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
29+
+ exitCode: 0
30+
diff --git a/resources.yaml b/resources.yaml
31+
index f2eec52..84cfb26 100644
32+
--- a/resources.yaml
33+
+++ b/resources.yaml
34+
@@ -15,12 +15,25 @@ apiVersion: apps/v1
35+
kind: Deployment
36+
metadata:
37+
name: nginx-deployment
38+
+ namespace: staging
39+
+ labels:
40+
+ tier: backend
41+
spec:
42+
replicas: 3
43+
+ selector:
44+
+ matchLabels:
45+
+ tier: backend
46+
+ template:
47+
+ metadata:
48+
+ labels:
49+
+ tier: backend
50+
---
51+
apiVersion: custom.io/v1
52+
kind: Custom
53+
metadata:
54+
name: custom
55+
+ namespace: staging
56+
+ labels:
57+
+ tier: backend
58+
spec:
59+
image: nginx:1.2.3
Lines changed: 5 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
diff --git a/Kptfile b/Kptfile
2-
index 2210a5f..5ccde1c 100755
2+
index eb90ac3..5ccde1c 100644
33
--- a/Kptfile
44
+++ b/Kptfile
5-
@@ -1,8 +1,17 @@
6-
-apiVersion: kpt.dev/v1
7-
-kind: Kptfile
8-
-metadata:
9-
- name: app
10-
-pipeline:
11-
- mutators:
12-
- - image: ghcr.io/kptdev/krm-functions-catalog/no-op
5+
@@ -5,4 +5,13 @@ metadata:
6+
pipeline:
7+
mutators:
8+
- image: ghcr.io/kptdev/krm-functions-catalog/no-op
139
- condition: "resources.exists(r, r.kind == 'ConfigMap' && r.metadata.name == 'app-config')"
14-
+apiVersion: kpt.dev/v1
15-
+kind: Kptfile
16-
+metadata:
17-
+ name: app
18-
+pipeline:
19-
+ mutators:
20-
+ - image: ghcr.io/kptdev/krm-functions-catalog/no-op
2110
+ condition: resources.exists(r, r.kind == 'ConfigMap' && r.metadata.name == 'app-config')
2211
+status:
2312
+ conditions:
@@ -28,34 +17,3 @@ index 2210a5f..5ccde1c 100755
2817
+ mutationSteps:
2918
+ - image: ghcr.io/kptdev/krm-functions-catalog/no-op:latest
3019
+ exitCode: 0
31-
diff --git a/resources.yaml b/resources.yaml
32-
index 2f4405b..47bec8b 100755
33-
--- a/resources.yaml
34-
+++ b/resources.yaml
35-
@@ -1,13 +1,13 @@
36-
-apiVersion: v1
37-
-kind: ConfigMap
38-
-metadata:
39-
- name: app-config
40-
-data:
41-
- key: value
42-
----
43-
-apiVersion: apps/v1
44-
-kind: Deployment
45-
-metadata:
46-
- name: my-app
47-
-spec:
48-
- replicas: 1
49-
+apiVersion: v1
50-
+kind: ConfigMap
51-
+metadata:
52-
+ name: app-config
53-
+data:
54-
+ key: value
55-
+---
56-
+apiVersion: apps/v1
57-
+kind: Deployment
58-
+metadata:
59-
+ name: my-app
60-
+spec:
61-
+ replicas: 1
Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
diff --git a/Kptfile b/Kptfile
2-
index 2210a5f..ac7ae33 100755
2+
index eb90ac3..ac7ae33 100644
33
--- a/Kptfile
44
+++ b/Kptfile
5-
@@ -1,8 +1,18 @@
6-
-apiVersion: kpt.dev/v1
7-
-kind: Kptfile
8-
-metadata:
9-
- name: app
10-
-pipeline:
11-
- mutators:
12-
- - image: ghcr.io/kptdev/krm-functions-catalog/no-op
5+
@@ -5,4 +5,14 @@ metadata:
6+
pipeline:
7+
mutators:
8+
- image: ghcr.io/kptdev/krm-functions-catalog/no-op
139
- condition: "resources.exists(r, r.kind == 'ConfigMap' && r.metadata.name == 'app-config')"
14-
+apiVersion: kpt.dev/v1
15-
+kind: Kptfile
16-
+metadata:
17-
+ name: app
18-
+pipeline:
19-
+ mutators:
20-
+ - image: ghcr.io/kptdev/krm-functions-catalog/no-op
2110
+ condition: resources.exists(r, r.kind == 'ConfigMap' && r.metadata.name == 'app-config')
2211
+status:
2312
+ conditions:
@@ -30,20 +19,13 @@ index 2210a5f..ac7ae33 100755
3019
+ exitCode: 0
3120
+ skipped: true
3221
diff --git a/resources.yaml b/resources.yaml
33-
index d9eb99a..c8cdecf 100755
22+
index 7806994..c8cdecf 100644
3423
--- a/resources.yaml
3524
+++ b/resources.yaml
36-
@@ -1,6 +1,6 @@
37-
-apiVersion: apps/v1
38-
-kind: Deployment
39-
-metadata:
40-
- name: my-app
41-
-spec:
25+
@@ -3,4 +3,4 @@ kind: Deployment
26+
metadata:
27+
name: my-app
28+
spec:
4229
- replicas: 1
4330
\ No newline at end of file
44-
+apiVersion: apps/v1
45-
+kind: Deployment
46-
+metadata:
47-
+ name: my-app
48-
+spec:
4931
+ replicas: 1

0 commit comments

Comments
 (0)