Skip to content

Commit 13ed78f

Browse files
committed
Add renderstatus to the kptfile
Signed-off-by: aravind.est <aravindhan.a@est.tech>
1 parent bebee38 commit 13ed78f

138 files changed

Lines changed: 2074 additions & 277 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

e2e/testdata/fn-render/all-resource-deletion/.expected/diff.patch

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/Kptfile b/Kptfile
2-
index 3c93e9e..fe0bc96 100644
2+
index 3c93e9e..5404a5a 100644
33
--- a/Kptfile
44
+++ b/Kptfile
55
@@ -2,6 +2,9 @@ apiVersion: kpt.dev/v1
@@ -12,7 +12,7 @@ index 3c93e9e..fe0bc96 100644
1212
pipeline:
1313
mutators:
1414
- image: ghcr.io/kptdev/krm-functions-catalog/starlark:latest
15-
@@ -12,3 +15,8 @@ pipeline:
15+
@@ -12,3 +15,16 @@ pipeline:
1616
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
1717
configMap:
1818
tier: backend
@@ -21,6 +21,14 @@ index 3c93e9e..fe0bc96 100644
2121
+ - type: Rendered
2222
+ status: "True"
2323
+ reason: RenderSuccess
24+
+ renderStatus:
25+
+ mutationSteps:
26+
+ - image: ghcr.io/kptdev/krm-functions-catalog/starlark:latest
27+
+ exitCode: 0
28+
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
29+
+ exitCode: 0
30+
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
31+
+ exitCode: 0
2432
diff --git a/delete-all.yaml b/delete-all.yaml
2533
index 3c86d8b..6754b0a 100644
2634
--- a/delete-all.yaml

e2e/testdata/fn-render/basicpipeline-semver/.expected/diff.patch

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/Kptfile b/Kptfile
2-
index 2336da4..eae3be3 100644
2+
index 2336da4..c1090e8 100644
33
--- a/Kptfile
44
+++ b/Kptfile
5-
@@ -2,13 +2,20 @@ apiVersion: kpt.dev/v1
5+
@@ -2,13 +2,34 @@ apiVersion: kpt.dev/v1
66
kind: Kptfile
77
metadata:
88
name: app
@@ -25,6 +25,20 @@ index 2336da4..eae3be3 100644
2525
+ - type: Rendered
2626
+ status: "True"
2727
+ reason: RenderSuccess
28+
+ renderStatus:
29+
+ mutationSteps:
30+
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-namespace
31+
+ exitCode: 0
32+
+ results:
33+
+ - message: namespace [default] updated to "staging", 1 value(s) changed
34+
+ severity: info
35+
+ - message: all `depends-on` annotations are up-to-date. no `namespace` changed
36+
+ severity: info
37+
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-labels
38+
+ exitCode: 0
39+
+ results:
40+
+ - message: set 4 labels in total
41+
+ severity: info
2842
diff --git a/resources.yaml b/resources.yaml
2943
index 1f15150..936d957 100644
3044
--- a/resources.yaml

e2e/testdata/fn-render/basicpipeline-symlink/.expected/diff.patch

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/Kptfile b/Kptfile
2-
index 1307fb5..f645d75 100644
2+
index 1307fb5..fee64dc 100644
33
--- a/Kptfile
44
+++ b/Kptfile
55
@@ -2,6 +2,9 @@ apiVersion: kpt.dev/v1
@@ -12,7 +12,7 @@ index 1307fb5..f645d75 100644
1212
pipeline:
1313
mutators:
1414
- image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
15-
@@ -10,3 +13,8 @@ pipeline:
15+
@@ -10,3 +13,14 @@ pipeline:
1616
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
1717
configMap:
1818
tier: backend
@@ -21,6 +21,12 @@ index 1307fb5..f645d75 100644
2121
+ - type: Rendered
2222
+ status: "True"
2323
+ 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
2430
diff --git a/resources.yaml b/resources.yaml
2531
index f2eec52..84cfb26 100644
2632
--- a/resources.yaml

e2e/testdata/fn-render/basicpipeline-wasm/.expected/diff.patch

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/Kptfile b/Kptfile
2-
index 17a7822..94b6f80 100644
2+
index 17a7822..98fa855 100644
33
--- a/Kptfile
44
+++ b/Kptfile
5-
@@ -12,3 +12,8 @@ pipeline:
5+
@@ -12,3 +12,22 @@ pipeline:
66
- image: ghcr.io/kptdev/krm-functions-catalog/wasm/set-labels:v0.2.4
77
configMap:
88
tier: backend
@@ -11,6 +11,20 @@ index 17a7822..94b6f80 100644
1111
+ - type: Rendered
1212
+ status: "True"
1313
+ reason: RenderSuccess
14+
+ renderStatus:
15+
+ mutationSteps:
16+
+ - image: ghcr.io/kptdev/krm-functions-catalog/wasm/set-namespace:v0.5.1
17+
+ exitCode: 0
18+
+ results:
19+
+ - message: namespace [default] updated to "staging", 1 value(s) changed
20+
+ severity: info
21+
+ - message: all `depends-on` annotations are up-to-date. no `namespace` changed
22+
+ severity: info
23+
+ - image: ghcr.io/kptdev/krm-functions-catalog/wasm/set-labels:v0.2.4
24+
+ exitCode: 0
25+
+ results:
26+
+ - message: set 4 labels in total
27+
+ severity: info
1428
diff --git a/resources.yaml b/resources.yaml
1529
index eed43d6..c1de2b0 100644
1630
--- a/resources.yaml

e2e/testdata/fn-render/basicpipeline/.expected/diff.patch

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/Kptfile b/Kptfile
2-
index 1307fb5..f645d75 100644
2+
index 1307fb5..fee64dc 100644
33
--- a/Kptfile
44
+++ b/Kptfile
55
@@ -2,6 +2,9 @@ apiVersion: kpt.dev/v1
@@ -12,7 +12,7 @@ index 1307fb5..f645d75 100644
1212
pipeline:
1313
mutators:
1414
- image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
15-
@@ -10,3 +13,8 @@ pipeline:
15+
@@ -10,3 +13,14 @@ pipeline:
1616
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
1717
configMap:
1818
tier: backend
@@ -21,6 +21,12 @@ index 1307fb5..f645d75 100644
2121
+ - type: Rendered
2222
+ status: "True"
2323
+ 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
2430
diff --git a/resources.yaml b/resources.yaml
2531
index f2eec52..84cfb26 100644
2632
--- a/resources.yaml

e2e/testdata/fn-render/default-runtime/.expected/diff.patch

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/Kptfile b/Kptfile
2-
index 1307fb5..f645d75 100644
2+
index 1307fb5..fee64dc 100644
33
--- a/Kptfile
44
+++ b/Kptfile
55
@@ -2,6 +2,9 @@ apiVersion: kpt.dev/v1
@@ -12,7 +12,7 @@ index 1307fb5..f645d75 100644
1212
pipeline:
1313
mutators:
1414
- image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
15-
@@ -10,3 +13,8 @@ pipeline:
15+
@@ -10,3 +13,14 @@ pipeline:
1616
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
1717
configMap:
1818
tier: backend
@@ -21,6 +21,12 @@ index 1307fb5..f645d75 100644
2121
+ - type: Rendered
2222
+ status: "True"
2323
+ 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
2430
diff --git a/resources.yaml b/resources.yaml
2531
index f2eec52..84cfb26 100644
2632
--- a/resources.yaml

e2e/testdata/fn-render/exec-function-stderr/.expected/diff.patch

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/Kptfile b/Kptfile
2-
index 6f2fe11..34a53c9 100644
2+
index 6f2fe11..c0c66f5 100644
33
--- a/Kptfile
44
+++ b/Kptfile
5-
@@ -4,4 +4,9 @@ metadata:
5+
@@ -4,4 +4,35 @@ metadata:
66
name: app
77
pipeline:
88
mutators:
@@ -13,6 +13,32 @@ index 6f2fe11..34a53c9 100644
1313
+ - type: Rendered
1414
+ status: "True"
1515
+ reason: RenderSuccess
16+
+ renderStatus:
17+
+ mutationSteps:
18+
+ - exec: ./testdata/fn-render/exec-function-stderr/function.sh
19+
+ stderr: |
20+
+ Hello world 0!
21+
+ Hello world 1!
22+
+ Hello world 2!
23+
+ Hello world 3!
24+
+ Hello world 4!
25+
+ Hello world 5!
26+
+ Hello world 6!
27+
+ Hello world 7!
28+
+ Hello world 8!
29+
+ Hello world 9!
30+
+ Hello world 10!
31+
+ Hello world 11!
32+
+ Hello world 12!
33+
+ Hello world 13!
34+
+ Hello world 14!
35+
+ Hello world 15!
36+
+ Hello world 16!
37+
+ Hello world 17!
38+
+ Hello world 18!
39+
+ Hello world 19!
40+
+ Hello world 20!
41+
+ exitCode: 0
1642
diff --git a/resources.yaml b/resources.yaml
1743
index 0f69886..ff4bde7 100644
1844
--- a/resources.yaml

e2e/testdata/fn-render/exec-function-with-args/.expected/diff.patch

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/Kptfile b/Kptfile
2-
index 0d98dbb..0dde5ad 100644
2+
index 0d98dbb..2f7e1c4 100644
33
--- a/Kptfile
44
+++ b/Kptfile
5-
@@ -4,4 +4,9 @@ metadata:
5+
@@ -4,4 +4,13 @@ metadata:
66
name: app
77
pipeline:
88
mutators:
@@ -13,6 +13,10 @@ index 0d98dbb..0dde5ad 100644
1313
+ - type: Rendered
1414
+ status: "True"
1515
+ reason: RenderSuccess
16+
+ renderStatus:
17+
+ mutationSteps:
18+
+ - exec: sed -e 's/foo/bar/'
19+
+ exitCode: 0
1620
diff --git a/resources.yaml b/resources.yaml
1721
index 0f69886..ff4bde7 100644
1822
--- a/resources.yaml

e2e/testdata/fn-render/exec-without-permissions/.expected/diff.patch

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/Kptfile b/Kptfile
2-
index 0d98dbb..aba9d69 100644
2+
index 0d98dbb..885a1d0 100644
33
--- a/Kptfile
44
+++ b/Kptfile
5-
@@ -4,4 +4,12 @@ metadata:
5+
@@ -4,4 +4,18 @@ metadata:
66
name: app
77
pipeline:
88
mutators:
@@ -16,3 +16,9 @@ index 0d98dbb..aba9d69 100644
1616
+ message: |-
1717
+ pkg.render: pkg .:
1818
+ pipeline.run: must run with `--allow-exec` option to allow running function binaries
19+
+ renderStatus:
20+
+ mutationSteps:
21+
+ - exec: sed -e 's/foo/bar/'
22+
+ executionError: must run with `--allow-exec` option to allow running function binaries
23+
+ exitCode: 0
24+
+ errorSummary: 'sed -e ''s/foo/bar/'': must run with `--allow-exec` option to allow running function binaries'

e2e/testdata/fn-render/fn-failure-output-no-truncate/.expected/diff.patch

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/Kptfile b/Kptfile
2-
index 0586af9..30e8359 100644
2+
index 0586af9..ff80297 100644
33
--- a/Kptfile
44
+++ b/Kptfile
5-
@@ -7,3 +7,11 @@ pipeline:
5+
@@ -7,3 +7,59 @@ pipeline:
66
- image: ghcr.io/kptdev/krm-functions-catalog/kubeconform:latest
77
configMap:
88
strict: "true"
@@ -14,3 +14,51 @@ index 0586af9..30e8359 100644
1414
+ message: |-
1515
+ pkg.render: pkg .:
1616
+ pipeline.run: already handled error
17+
+ renderStatus:
18+
+ mutationSteps:
19+
+ - image: ghcr.io/kptdev/krm-functions-catalog/kubeconform:latest
20+
+ stderr: 'failed to evaluate function: error: function failure'
21+
+ exitCode: 1
22+
+ results:
23+
+ - message: missing properties 'selector', 'template'
24+
+ severity: error
25+
+ resourceRef:
26+
+ apiVersion: apps/v1
27+
+ kind: Deployment
28+
+ name: nginx-deployment
29+
+ field:
30+
+ path: spec
31+
+ file:
32+
+ path: resources.yaml
33+
+ - message: got string, want null or integer
34+
+ severity: error
35+
+ resourceRef:
36+
+ apiVersion: apps/v1
37+
+ kind: Deployment
38+
+ name: nginx-deployment
39+
+ field:
40+
+ path: spec.replicas
41+
+ file:
42+
+ path: resources.yaml
43+
+ errorResults:
44+
+ - message: missing properties 'selector', 'template'
45+
+ severity: error
46+
+ resourceRef:
47+
+ apiVersion: apps/v1
48+
+ kind: Deployment
49+
+ name: nginx-deployment
50+
+ field:
51+
+ path: spec
52+
+ file:
53+
+ path: resources.yaml
54+
+ - message: got string, want null or integer
55+
+ severity: error
56+
+ resourceRef:
57+
+ apiVersion: apps/v1
58+
+ kind: Deployment
59+
+ name: nginx-deployment
60+
+ field:
61+
+ path: spec.replicas
62+
+ file:
63+
+ path: resources.yaml
64+
+ errorSummary: 'ghcr.io/kptdev/krm-functions-catalog/kubeconform:latest: exit code 1'

0 commit comments

Comments
 (0)