Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/Kptfile b/Kptfile
index 3c93e9e..fe0bc96 100644
index 3c93e9e..5404a5a 100644
--- a/Kptfile
+++ b/Kptfile
@@ -2,6 +2,9 @@ apiVersion: kpt.dev/v1
Expand All @@ -12,7 +12,7 @@ index 3c93e9e..fe0bc96 100644
pipeline:
mutators:
- image: ghcr.io/kptdev/krm-functions-catalog/starlark:latest
@@ -12,3 +15,8 @@ pipeline:
@@ -12,3 +15,16 @@ pipeline:
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
configMap:
tier: backend
Expand All @@ -21,6 +21,14 @@ index 3c93e9e..fe0bc96 100644
+ - type: Rendered
+ status: "True"
+ reason: RenderSuccess
+ renderStatus:
+ mutationSteps:
+ - image: ghcr.io/kptdev/krm-functions-catalog/starlark:latest
+ exitCode: 0
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
+ exitCode: 0
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
+ exitCode: 0
diff --git a/delete-all.yaml b/delete-all.yaml
index 3c86d8b..6754b0a 100644
--- a/delete-all.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/Kptfile b/Kptfile
index 2336da4..eae3be3 100644
index 2336da4..c1090e8 100644
--- a/Kptfile
+++ b/Kptfile
@@ -2,13 +2,20 @@ apiVersion: kpt.dev/v1
@@ -2,13 +2,34 @@ apiVersion: kpt.dev/v1
kind: Kptfile
metadata:
name: app
Expand All @@ -25,6 +25,20 @@ index 2336da4..eae3be3 100644
+ - type: Rendered
+ status: "True"
+ reason: RenderSuccess
+ renderStatus:
+ mutationSteps:
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-namespace
+ exitCode: 0
+ results:
+ - message: namespace [default] updated to "staging", 1 value(s) changed
+ severity: info
+ - message: all `depends-on` annotations are up-to-date. no `namespace` changed
+ severity: info
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-labels
+ exitCode: 0
+ results:
+ - message: set 4 labels in total
+ severity: info
diff --git a/resources.yaml b/resources.yaml
index 1f15150..936d957 100644
--- a/resources.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/Kptfile b/Kptfile
index 1307fb5..f645d75 100644
index 1307fb5..fee64dc 100644
--- a/Kptfile
+++ b/Kptfile
@@ -2,6 +2,9 @@ apiVersion: kpt.dev/v1
Expand All @@ -12,7 +12,7 @@ index 1307fb5..f645d75 100644
pipeline:
mutators:
- image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
@@ -10,3 +13,8 @@ pipeline:
@@ -10,3 +13,14 @@ pipeline:
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
configMap:
tier: backend
Expand All @@ -21,6 +21,12 @@ index 1307fb5..f645d75 100644
+ - type: Rendered
+ status: "True"
+ reason: RenderSuccess
+ renderStatus:
+ mutationSteps:
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
+ exitCode: 0
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
+ exitCode: 0
diff --git a/resources.yaml b/resources.yaml
index f2eec52..84cfb26 100644
--- a/resources.yaml
Expand Down
18 changes: 16 additions & 2 deletions e2e/testdata/fn-render/basicpipeline-wasm/.expected/diff.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/Kptfile b/Kptfile
index 17a7822..94b6f80 100644
index 17a7822..98fa855 100644
--- a/Kptfile
+++ b/Kptfile
@@ -12,3 +12,8 @@ pipeline:
@@ -12,3 +12,22 @@ pipeline:
- image: ghcr.io/kptdev/krm-functions-catalog/wasm/set-labels:v0.2.4
configMap:
tier: backend
Expand All @@ -11,6 +11,20 @@ index 17a7822..94b6f80 100644
+ - type: Rendered
+ status: "True"
+ reason: RenderSuccess
+ renderStatus:
+ mutationSteps:
+ - image: ghcr.io/kptdev/krm-functions-catalog/wasm/set-namespace:v0.5.1
+ exitCode: 0
+ results:
+ - message: namespace [default] updated to "staging", 1 value(s) changed
+ severity: info
+ - message: all `depends-on` annotations are up-to-date. no `namespace` changed
+ severity: info
+ - image: ghcr.io/kptdev/krm-functions-catalog/wasm/set-labels:v0.2.4
+ exitCode: 0
+ results:
+ - message: set 4 labels in total
+ severity: info
diff --git a/resources.yaml b/resources.yaml
index eed43d6..c1de2b0 100644
--- a/resources.yaml
Expand Down
10 changes: 8 additions & 2 deletions e2e/testdata/fn-render/basicpipeline/.expected/diff.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/Kptfile b/Kptfile
index 1307fb5..f645d75 100644
index 1307fb5..fee64dc 100644
--- a/Kptfile
+++ b/Kptfile
@@ -2,6 +2,9 @@ apiVersion: kpt.dev/v1
Expand All @@ -12,7 +12,7 @@ index 1307fb5..f645d75 100644
pipeline:
mutators:
- image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
@@ -10,3 +13,8 @@ pipeline:
@@ -10,3 +13,14 @@ pipeline:
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
configMap:
tier: backend
Expand All @@ -21,6 +21,12 @@ index 1307fb5..f645d75 100644
+ - type: Rendered
+ status: "True"
+ reason: RenderSuccess
+ renderStatus:
+ mutationSteps:
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
+ exitCode: 0
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
+ exitCode: 0
diff --git a/resources.yaml b/resources.yaml
index f2eec52..84cfb26 100644
--- a/resources.yaml
Expand Down
10 changes: 8 additions & 2 deletions e2e/testdata/fn-render/default-runtime/.expected/diff.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/Kptfile b/Kptfile
index 1307fb5..f645d75 100644
index 1307fb5..fee64dc 100644
--- a/Kptfile
+++ b/Kptfile
@@ -2,6 +2,9 @@ apiVersion: kpt.dev/v1
Expand All @@ -12,7 +12,7 @@ index 1307fb5..f645d75 100644
pipeline:
mutators:
- image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
@@ -10,3 +13,8 @@ pipeline:
@@ -10,3 +13,14 @@ pipeline:
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
configMap:
tier: backend
Expand All @@ -21,6 +21,12 @@ index 1307fb5..f645d75 100644
+ - type: Rendered
+ status: "True"
+ reason: RenderSuccess
+ renderStatus:
+ mutationSteps:
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
+ exitCode: 0
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
+ exitCode: 0
diff --git a/resources.yaml b/resources.yaml
index f2eec52..84cfb26 100644
--- a/resources.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/Kptfile b/Kptfile
index 6f2fe11..34a53c9 100644
index 6f2fe11..c0c66f5 100644
--- a/Kptfile
+++ b/Kptfile
@@ -4,4 +4,9 @@ metadata:
@@ -4,4 +4,35 @@ metadata:
name: app
pipeline:
mutators:
Expand All @@ -13,6 +13,32 @@ index 6f2fe11..34a53c9 100644
+ - type: Rendered
+ status: "True"
+ reason: RenderSuccess
+ renderStatus:
+ mutationSteps:
+ - exec: ./testdata/fn-render/exec-function-stderr/function.sh
+ stderr: |
+ Hello world 0!
+ Hello world 1!
+ Hello world 2!
+ Hello world 3!
+ Hello world 4!
+ Hello world 5!
+ Hello world 6!
+ Hello world 7!
+ Hello world 8!
+ Hello world 9!
+ Hello world 10!
+ Hello world 11!
+ Hello world 12!
+ Hello world 13!
+ Hello world 14!
+ Hello world 15!
+ Hello world 16!
+ Hello world 17!
+ Hello world 18!
+ Hello world 19!
+ Hello world 20!
+ exitCode: 0
diff --git a/resources.yaml b/resources.yaml
index 0f69886..ff4bde7 100644
--- a/resources.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/Kptfile b/Kptfile
index 0d98dbb..0dde5ad 100644
index 0d98dbb..2f7e1c4 100644
--- a/Kptfile
+++ b/Kptfile
@@ -4,4 +4,9 @@ metadata:
@@ -4,4 +4,13 @@ metadata:
name: app
pipeline:
mutators:
Expand All @@ -13,6 +13,10 @@ index 0d98dbb..0dde5ad 100644
+ - type: Rendered
+ status: "True"
+ reason: RenderSuccess
+ renderStatus:
+ mutationSteps:
+ - exec: sed -e 's/foo/bar/'
+ exitCode: 0
diff --git a/resources.yaml b/resources.yaml
index 0f69886..ff4bde7 100644
--- a/resources.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/Kptfile b/Kptfile
index 0d98dbb..aba9d69 100644
index 0d98dbb..a70d5e2 100644
--- a/Kptfile
+++ b/Kptfile
@@ -4,4 +4,12 @@ metadata:
@@ -4,4 +4,18 @@ metadata:
name: app
pipeline:
mutators:
Expand All @@ -16,3 +16,9 @@ index 0d98dbb..aba9d69 100644
+ message: |-
+ pkg.render: pkg .:
+ pipeline.run: must run with `--allow-exec` option to allow running function binaries
+ renderStatus:
+ mutationSteps:
+ - exec: sed -e 's/foo/bar/'
+ executionError: must run with `--allow-exec` option to allow running function binaries
+ exitCode: 1
+ errorSummary: 'sed -e ''s/foo/bar/'': must run with `--allow-exec` option to allow running function binaries'
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/Kptfile b/Kptfile
index 0586af9..30e8359 100644
index 0586af9..ff80297 100644
--- a/Kptfile
+++ b/Kptfile
@@ -7,3 +7,11 @@ pipeline:
@@ -7,3 +7,59 @@ pipeline:
- image: ghcr.io/kptdev/krm-functions-catalog/kubeconform:latest
configMap:
strict: "true"
Expand All @@ -14,3 +14,51 @@ index 0586af9..30e8359 100644
+ message: |-
+ pkg.render: pkg .:
+ pipeline.run: already handled error
+ renderStatus:
+ mutationSteps:
+ - image: ghcr.io/kptdev/krm-functions-catalog/kubeconform:latest
+ stderr: 'failed to evaluate function: error: function failure'
+ exitCode: 1
+ results:
+ - message: missing properties 'selector', 'template'
+ severity: error
+ resourceRef:
+ apiVersion: apps/v1
+ kind: Deployment
+ name: nginx-deployment
+ field:
+ path: spec
+ file:
+ path: resources.yaml
+ - message: got string, want null or integer
+ severity: error
+ resourceRef:
+ apiVersion: apps/v1
+ kind: Deployment
+ name: nginx-deployment
+ field:
+ path: spec.replicas
+ file:
+ path: resources.yaml
+ errorResults:
+ - message: missing properties 'selector', 'template'
+ severity: error
+ resourceRef:
+ apiVersion: apps/v1
+ kind: Deployment
+ name: nginx-deployment
+ field:
+ path: spec
+ file:
+ path: resources.yaml
+ - message: got string, want null or integer
+ severity: error
+ resourceRef:
+ apiVersion: apps/v1
+ kind: Deployment
+ name: nginx-deployment
+ field:
+ path: spec.replicas
+ file:
+ path: resources.yaml
+ errorSummary: 'ghcr.io/kptdev/krm-functions-catalog/kubeconform:latest: exit code 1'
16 changes: 14 additions & 2 deletions e2e/testdata/fn-render/fn-failure/.expected/diff.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/Kptfile b/Kptfile
index 3447ba3..2802b20 100644
index 3447ba3..9127985 100644
--- a/Kptfile
+++ b/Kptfile
@@ -4,12 +4,19 @@ metadata:
@@ -4,12 +4,31 @@ metadata:
name: app
pipeline:
mutators:
Expand Down Expand Up @@ -31,3 +31,15 @@ index 3447ba3..2802b20 100644
+ message: |-
+ pkg.render: pkg .:
+ pipeline.run: already handled error
+ renderStatus:
+ mutationSteps:
+ - image: ghcr.io/kptdev/krm-functions-catalog/starlark:latest
+ stderr: 'failed to evaluate function: error: function failure'
+ exitCode: 1
+ results:
+ - message: 'httpbin-gen:3:73: got newline, want primary expression'
+ severity: error
+ errorResults:
+ - message: 'httpbin-gen:3:73: got newline, want primary expression'
+ severity: error
+ errorSummary: 'ghcr.io/kptdev/krm-functions-catalog/starlark:latest: exit code 1'
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/Kptfile b/Kptfile
index f591880..b8c4faf 100644
index f591880..1a3d92d 100644
--- a/Kptfile
+++ b/Kptfile
@@ -6,3 +6,8 @@ pipeline:
@@ -6,3 +6,13 @@ pipeline:
mutators:
- image: ghcr.io/kptdev/krm-functions-catalog/starlark:latest
configPath: starlark.yaml
Expand All @@ -11,3 +11,8 @@ index f591880..b8c4faf 100644
+ - type: Rendered
+ status: "True"
+ reason: RenderSuccess
+ renderStatus:
+ mutationSteps:
+ - image: ghcr.io/kptdev/krm-functions-catalog/starlark:latest
+ stderr: function succeeded, reporting it on stderr
+ exitCode: 0
Loading
Loading