Skip to content
Open
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
9 changes: 1 addition & 8 deletions e2e/testdata/fn-eval/default-runtime/.expected/diff.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/resources.yaml b/resources.yaml
index f2eec52..b66c419 100644
index f2eec52..f169ab0 100644
--- a/resources.yaml
+++ b/resources.yaml
@@ -15,6 +15,7 @@ apiVersion: apps/v1
Expand All @@ -10,10 +10,3 @@ index f2eec52..b66c419 100644
spec:
replicas: 3
---
@@ -22,5 +23,6 @@ apiVersion: custom.io/v1
kind: Custom
metadata:
name: custom
+ namespace: staging
spec:
image: nginx:1.2.3
4 changes: 2 additions & 2 deletions e2e/testdata/fn-eval/default-runtime/.expected/exec.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/bash
# Copyright 2021 The kpt Authors
# Copyright 2021-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -22,4 +22,4 @@ fi

echo "KRM_FN_RUNTIME is ${KRM_FN_RUNTIME}"
# run eval with KRM_FN_RUNTIME unset.
kpt fn eval -i ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0 -- namespace=staging
kpt fn eval -i ghcr.io/kptdev/krm-functions-catalog/set-namespace:latest -- namespace=staging
4 changes: 2 additions & 2 deletions e2e/testdata/fn-eval/error-in-pipe/.expected/exec.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/bash
# Copyright 2021 The kpt Authors
# Copyright 2021-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,6 @@ set -eo pipefail
rm -rf out

kpt fn source \
| kpt fn eval - --image ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0 \
| kpt fn eval - --image ghcr.io/kptdev/krm-functions-catalog/set-namespace:latest \
| kpt fn eval - --image ghcr.io/kptdev/krm-functions-catalog/dne -- foo=bar \
| kpt fn sink out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 The kpt Authors
# Copyright 2021-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,5 +13,5 @@
# limitations under the License.

testType: eval
image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:latest
fnConfig: ../config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ index 003e3fe..7a2ceea 100644
data:
namespace: staging
diff --git a/resources.yaml b/resources.yaml
index f2eec52..b66c419 100644
index f2eec52..f169ab0 100644
--- a/resources.yaml
+++ b/resources.yaml
@@ -15,6 +15,7 @@ apiVersion: apps/v1
Expand All @@ -21,10 +21,3 @@ index f2eec52..b66c419 100644
spec:
replicas: 3
---
@@ -22,5 +23,6 @@ apiVersion: custom.io/v1
kind: Custom
metadata:
name: custom
+ namespace: staging
spec:
image: nginx:1.2.3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 The kpt Authors
# Copyright 2021-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,5 +13,5 @@
# limitations under the License.

testType: eval
image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:latest
fnConfig: ../../config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/resources.yaml b/resources.yaml
index f2eec52..b66c419 100644
index f2eec52..f169ab0 100644
--- a/resources.yaml
+++ b/resources.yaml
@@ -15,6 +15,7 @@ apiVersion: apps/v1
Expand All @@ -10,10 +10,3 @@ index f2eec52..b66c419 100644
spec:
replicas: 3
---
@@ -22,5 +23,6 @@ apiVersion: custom.io/v1
kind: Custom
metadata:
name: custom
+ namespace: staging
spec:
image: nginx:1.2.3
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
diff --git a/out/Kptfile b/out/Kptfile
new file mode 100644
index 0000000..ede2393
index 0000000..28956fc
--- /dev/null
+++ b/out/Kptfile
@@ -0,0 +1,9 @@
@@ -0,0 +1,8 @@
+apiVersion: kpt.dev/v1
+kind: Kptfile
+metadata:
+ name: app
+ namespace: staging
+pipeline:
+ mutators:
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-labels:latest
+ configPath: labelconfig.yaml
diff --git a/out/labelconfig.yaml b/out/labelconfig.yaml
new file mode 100644
Expand Down Expand Up @@ -41,10 +40,10 @@ index 0000000..37baaa2
+ tier: app
diff --git a/out/resources.yaml b/out/resources.yaml
new file mode 100644
index 0000000..b66c419
index 0000000..f169ab0
--- /dev/null
+++ b/out/resources.yaml
@@ -0,0 +1,28 @@
@@ -0,0 +1,27 @@
+# Copyright 2021 The kpt Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -70,6 +69,5 @@ index 0000000..b66c419
+kind: Custom
+metadata:
+ name: custom
+ namespace: staging
+spec:
+ image: nginx:1.2.3
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/bash
# Copyright 2021 The kpt Authors
# Copyright 2021-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -18,5 +18,5 @@ set -eo pipefail
rm -rf out

kpt fn source \
| kpt fn eval - --image ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0 -- namespace=staging \
| kpt fn eval - --image ghcr.io/kptdev/krm-functions-catalog/set-namespace:latest -- namespace=staging \
| kpt fn sink out
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
name: app
pipeline:
mutators:
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:latest
configPath: labelconfig.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
diff --git a/out/Kptfile b/out/Kptfile
new file mode 100644
index 0000000..ede2393
index 0000000..28956fc
--- /dev/null
+++ b/out/Kptfile
@@ -0,0 +1,9 @@
@@ -0,0 +1,8 @@
+apiVersion: kpt.dev/v1
+kind: Kptfile
+metadata:
+ name: app
+ namespace: staging
+pipeline:
+ mutators:
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
+ - image: ghcr.io/kptdev/krm-functions-catalog/set-labels:latest
+ configPath: labelconfig.yaml
diff --git a/out/labelconfig.yaml b/out/labelconfig.yaml
new file mode 100644
Expand Down Expand Up @@ -41,10 +40,10 @@ index 0000000..37baaa2
+ tier: app
diff --git a/out/resources.yaml b/out/resources.yaml
new file mode 100644
index 0000000..b66c419
index 0000000..f169ab0
--- /dev/null
+++ b/out/resources.yaml
@@ -0,0 +1,28 @@
@@ -0,0 +1,27 @@
+# Copyright 2021 The kpt Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -70,6 +69,5 @@ index 0000000..b66c419
+kind: Custom
+metadata:
+ name: custom
+ namespace: staging
+spec:
+ image: nginx:1.2.3
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/bash
# Copyright 2021 The kpt Authors
# Copyright 2021-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -18,5 +18,5 @@ set -eo pipefail
rm -rf out

kpt fn source \
| kpt fn eval - --image ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0 -- namespace=staging \
| kpt fn eval - --image ghcr.io/kptdev/krm-functions-catalog/set-namespace:latest -- namespace=staging \
| kpt fn sink out
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
name: app
pipeline:
mutators:
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:latest
configPath: labelconfig.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 The kpt Authors
# Copyright 2021-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
# limitations under the License.

testType: eval
image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:latest
fnConfig: ../../config.yaml
exitCode: 1
stdErr: "resource must have `metadata.name`"
9 changes: 2 additions & 7 deletions e2e/testdata/fn-eval/function-chain/.expected/diff.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
diff --git a/out/resources.yaml b/out/resources.yaml
new file mode 100644
index 0000000..94ced72
index 0000000..840637b
--- /dev/null
+++ b/out/resources.yaml
@@ -0,0 +1,39 @@
@@ -0,0 +1,34 @@
+# Copyright 2021 The kpt Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -29,16 +29,11 @@ index 0000000..94ced72
+ selector:
+ matchLabels:
+ foo: bar
+ template:
+ metadata:
+ labels:
+ foo: bar
+---
+apiVersion: custom.io/v1
+kind: Custom
+metadata:
+ name: custom
+ namespace: staging
+ labels:
+ foo: bar
+spec:
Expand Down
6 changes: 3 additions & 3 deletions e2e/testdata/fn-eval/function-chain/.expected/exec.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/bash
# Copyright 2021 The kpt Authors
# Copyright 2021-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,6 @@ set -eo pipefail
rm -rf out

kpt fn source \
| kpt fn eval - --image ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0 -- namespace=staging \
| kpt fn eval - --image ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5 -- foo=bar \
| kpt fn eval - --image ghcr.io/kptdev/krm-functions-catalog/set-namespace:latest -- namespace=staging \
| kpt fn eval - --image ghcr.io/kptdev/krm-functions-catalog/set-labels:latest -- foo=bar \
| kpt fn sink out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 The kpt Authors
# Copyright 2021-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@

runCount: 2
testType: eval
image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:latest
includeMetaResources: true
exitCode: 1
args:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 The kpt Authors
# Copyright 2021-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@

runCount: 2
testType: eval
image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:latest
includeMetaResources: true
exitCode: 1
args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
name: app
pipeline:
mutators:
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:latest
configPath: labelconfig.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 The kpt Authors
# Copyright 2021-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@

runCount: 2
testType: eval
image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:latest
includeMetaResources: true
exitCode: 1
args:
Expand Down
2 changes: 1 addition & 1 deletion e2e/testdata/fn-eval/include-meta-resources/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
name: app
pipeline:
mutators:
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
- image: ghcr.io/kptdev/krm-functions-catalog/set-labels:latest
configPath: labelconfig.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 The kpt Authors
# Copyright 2021-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,6 +14,6 @@

testType: eval
exitCode: 1
image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0
image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:latest
fnConfig: ../../config.yaml
stdErr: "wrong node kind: expected MappingNode but got ScalarNode: node contents:\nI am not a valid config file\n"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 The kpt Authors
# Copyright 2021-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,6 +13,6 @@
# limitations under the License.

testType: eval
image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1.5
image: ghcr.io/kptdev/krm-functions-catalog/set-labels:latest
args:
tier: backend
Loading
Loading