Skip to content

Commit

Permalink
starlark fn v0.1 to v0.2 (#2415)
Browse files Browse the repository at this point in the history
* starlark fn v0.1 to v0.2

* use starlark v0.2.1

* update expected
  • Loading branch information
Mengqi Yu committed Aug 2, 2021
1 parent fdfcc68 commit 20037c7
Show file tree
Hide file tree
Showing 41 changed files with 56 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.

testType: eval
image: gcr.io/kpt-fn/starlark:v0.1.0
image: gcr.io/kpt-fn/starlark:v0.2.1
fnConfig: ../../starlark-delete-resource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ index 0000000..254b9cd
+ name: custom
+ namespace: staging
+spec:
+ image: nginx:1.2.3
+ image: nginx:1.2.3
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ index 0000000..254b9cd
+ name: custom
+ namespace: staging
+spec:
+ image: nginx:1.2.3
+ image: nginx:1.2.3
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ index 0000000..254b9cd
+ name: custom
+ namespace: staging
+spec:
+ image: nginx:1.2.3
+ image: nginx:1.2.3
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ index 0000000..254b9cd
+ name: custom
+ namespace: staging
+spec:
+ image: nginx:1.2.3
+ image: nginx:1.2.3
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
testType: eval
image: gcr.io/kpt-fn/starlark:v0.1
image: gcr.io/kpt-fn/starlark:v0.2
fnConfig: ../../starlark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: fnresults
exitCode: 0
items:
- image: gcr.io/kpt-fn/starlark:v0.1
- image: gcr.io/kpt-fn/starlark:v0.2
stderr: |
function succeeded, reporting it on stderr
exitCode: 0
2 changes: 1 addition & 1 deletion e2e/testdata/fn-eval/function-chain/.expected/diff.patch
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ index 0000000..0298ad0
+ labels:
+ foo: bar
+spec:
+ image: nginx:1.2.3
+ image: nginx:1.2.3
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/Kptfile b/Kptfile
index 1f982e2..70d659f 100644
index 5886e29..218e01d 100644
--- a/Kptfile
+++ b/Kptfile
@@ -2,6 +2,7 @@ apiVersion: kpt.dev/v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pipeline:
tag: 1.14.1
- image: gcr.io/kpt-fn/set-labels:v0.1.4
configPath: ./fn-config.yaml
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: path/to/foo-star.yaml
inventory:
namespace: some-space
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.

testType: eval
image: gcr.io/kpt-fn/starlark:v0.1.0
image: gcr.io/kpt-fn/starlark:v0.2.1
fnConfig: ../../starlark-delete-resource.yaml
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/all-resource-deletion/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: app
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: delete-all.yaml
- image: gcr.io/kpt-fn/set-namespace:v0.1.3
configMap:
Expand Down
6 changes: 3 additions & 3 deletions e2e/testdata/fn-render/fn-failure/.expected/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
# non-zero exit code and no changes in the resources.
exitCode: 1
stdErr: |
[RUNNING] "gcr.io/kpt-fn/starlark:v0.1.0"
[FAIL] "gcr.io/kpt-fn/starlark:v0.1.0"
[RUNNING] "gcr.io/kpt-fn/starlark:v0.2.1"
[FAIL] "gcr.io/kpt-fn/starlark:v0.2.1"
Results:
[ERROR] httpbin-gen:4:1: got newline, want primary expression
Stderr:
"httpbin-gen:4:1: got newline, want primary expression"
"[error] : httpbin-gen:4:1: got newline, want primary expression"
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/fn-failure/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
pipeline:
mutators:
# invalid starlark input results in failure of first fn
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: starlark-failure-fn.yaml
- image: gcr.io/kpt-fn/set-namespace:v0.1.3
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: fnresults
exitCode: 0
items:
- image: gcr.io/kpt-fn/starlark:v0.1
- image: gcr.io/kpt-fn/starlark:v0.2
stderr: |
function succeeded, reporting it on stderr
exitCode: 0
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/fn-success-with-stderr/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
name: app
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.1
- image: gcr.io/kpt-fn/starlark:v0.2
configPath: starlark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ index 7a494c9..254b9cd 100644
name: custom
+ namespace: staging
spec:
image: nginx:1.2.3
image: nginx:1.2.3
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff --git a/another/file/out.yaml b/another/file/out.yaml
new file mode 100644
index 0000000..6d9fb79
index 0000000..f36c98e
--- /dev/null
+++ b/another/file/out.yaml
@@ -0,0 +1,13 @@
Expand All @@ -13,7 +13,7 @@ index 0000000..6d9fb79
+ template:
+ spec:
+ containers:
+ - name: httpbin
+ image: kennethreitz/httpbin
+ - image: kennethreitz/httpbin
+ name: httpbin
+ ports:
+ - containerPort: 9876
+ - containerPort: 9876
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/generator-absolute-path/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
name: db
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: starlark-httpbin.yaml
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/generator/db/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: db
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.2.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: starlark-httpbin.yaml
- image: gcr.io/kpt-fn/set-namespace:v0.1.3
configMap:
Expand Down
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/path-index-ancestor/db/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
name: db
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: starlark-httpbin-gen.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff --git a/deployment_httpbin.yaml b/deployment_httpbin.yaml
new file mode 100644
index 0000000..6d9fb79
index 0000000..f36c98e
--- /dev/null
+++ b/deployment_httpbin.yaml
@@ -0,0 +1,13 @@
Expand All @@ -13,7 +13,7 @@ index 0000000..6d9fb79
+ template:
+ spec:
+ containers:
+ - name: httpbin
+ image: kennethreitz/httpbin
+ - image: kennethreitz/httpbin
+ name: httpbin
+ ports:
+ - containerPort: 9876
+ - containerPort: 9876
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/path-index-current/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
name: app-with-generator
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: starlark-httpbin-gen.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff --git a/db/deployment_httpbin.yaml b/db/deployment_httpbin.yaml
new file mode 100644
index 0000000..6d9fb79
index 0000000..f36c98e
--- /dev/null
+++ b/db/deployment_httpbin.yaml
@@ -0,0 +1,13 @@
Expand All @@ -13,7 +13,7 @@ index 0000000..6d9fb79
+ template:
+ spec:
+ containers:
+ - name: httpbin
+ image: kennethreitz/httpbin
+ - image: kennethreitz/httpbin
+ name: httpbin
+ ports:
+ - containerPort: 9876
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/path-index-descendent/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
name: app-with-generator
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: starlark-httpbin-gen.yaml
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/path-index-duplicate/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
name: db
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: starlark-gen-duplicate-path.yaml
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/path-index-outofpackage/db/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
name: db
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: starlark-httpbin-gen.yaml
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/resource-deletion/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: app
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: starlark-httpbin.yaml
- image: gcr.io/kpt-fn/set-namespace:v0.1.3
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ index f7bdc2a..f555993 100644
+ abc: def
spec:
containers:
- name: wordpress
- name: wordpress
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ items:
- image: gcr.io/kpt-fn/set-namespace:v0.1.3
exitCode: 0
- image: gcr.io/kpt-fn/set-labels:v0.1.4
exitCode: 0
exitCode: 0
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/subpkg-fn-failure/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: app
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: starlark-httpbin.yaml
- image: gcr.io/kpt-fn/set-namespace:v0.1.3
configMap:
Expand Down
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/subpkg-fn-failure/db/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: db
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: statefulset-filter.yaml
- image: gcr.io/kpt-fn/set-namespace:v0.1.3
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: db
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
# malformed Kptfile
configPath: statefulset-filter.yaml
- image: gcr.io/kpt-fn/set-namespace:v0.1.3
Expand Down
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/subpkg-resource-deletion/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: app
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: starlark-httpbin.yaml
- image: gcr.io/kpt-fn/set-namespace:v0.1.3
configMap:
Expand Down
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/subpkg-resource-deletion/db/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: db
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: statefulset-filter.yaml
- image: gcr.io/kpt-fn/set-namespace:v0.1.3
configMap:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff --git a/deployment_httpbin.yaml b/deployment_httpbin.yaml
new file mode 100644
index 0000000..6d9fb79
index 0000000..f36c98e
--- /dev/null
+++ b/deployment_httpbin.yaml
@@ -0,0 +1,13 @@
Expand All @@ -13,7 +13,7 @@ index 0000000..6d9fb79
+ template:
+ spec:
+ containers:
+ - name: httpbin
+ image: kennethreitz/httpbin
+ - image: kennethreitz/httpbin
+ name: httpbin
+ ports:
+ - containerPort: 9876
4 changes: 2 additions & 2 deletions e2e/testdata/fn-render/validate-generated-resource/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
name: db
pipeline:
mutators:
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: starlark-httpbin-gen.yaml
validators:
- image: gcr.io/kpt-fn/starlark:v0.1.0
- image: gcr.io/kpt-fn/starlark:v0.2.1
configPath: starlark-httpbin-val.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
name: fnresults
exitCode: 1
items:
- image: gcr.io/kpt-fn/starlark:v0.1.0
stderr: 'fail: could not find httpbin deployment'
- image: gcr.io/kpt-fn/starlark:v0.2.1
stderr: '[error] : fail: could not find httpbin deployment'
exitCode: 1
results:
- message: 'fail: could not find httpbin deployment'
Expand Down
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/validate-resource-failure/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
name: db
pipeline:
validators:
- image: gcr.io/kpt-fn/starlark:v0.1.0 # validates httpbin deployment exists
- image: gcr.io/kpt-fn/starlark:v0.2.1 # validates httpbin deployment exists
configPath: starlark-httpbin-val.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ provide your business logic.
The following is an example package with a `starlark` function declaration:

```shell
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/starlark-set-namespace@starlark/v0.1
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/starlark-set-namespace@starlark/v0.2
```

It contains the following `functionConfig`:
Expand Down Expand Up @@ -42,7 +42,7 @@ $ kpt fn render set-namespace

You should now see that resources have `namespace` set to `prod`.

?> Refer to the [Functions Catalog](https://catalog.kpt.dev/starlark/v0.1/) for
?> Refer to the [Functions Catalog](https://catalog.kpt.dev/starlark/v0.2/) for
details on how use this function.

## `gatekeeper` function
Expand Down
2 changes: 1 addition & 1 deletion site/installation/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ kpt `v0.39`) to `v1` version(compatible with kpt `v1.0`).
[v0.39 commands]: https://googlecontainertools.github.io/kpt/reference/
[v1.0 commands]: https://kpt.dev/reference/cli/
[v1 kptfile]: https://github.com/GoogleContainerTools/kpt/blob/main/pkg/api/kptfile/v1/types.go
[starlark function]: https://catalog.kpt.dev/starlark/v0.1/
[starlark function]: https://catalog.kpt.dev/starlark/v0.2/
[apply-setters]: https://catalog.kpt.dev/apply-setters/v0.1/
[setter inheritance]: https://googlecontainertools.github.io/kpt/concepts/setters/#inherit-setter-values-from-parent-package
[openapi validations]: https://googlecontainertools.github.io/kpt/guides/producer/setters/#openapi-validations
Expand Down

0 comments on commit 20037c7

Please sign in to comment.