Skip to content

Commit

Permalink
update for kubeval/v0.2 (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mengqi Yu committed Oct 14, 2021
1 parent 69f7c60 commit ddbd9dd
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion examples/kubeval-imperative/.expected/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
exitCode: 1
testType: eval
image: gcr.io/kpt-fn/kubeval:unstable
image: gcr.io/kpt-fn/kubeval:v0.2
args:
strict: 'true'
skip_kinds: MyCustom,MyOtherCustom
2 changes: 1 addition & 1 deletion examples/kubeval-imperative/.expected/results.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: fnresults
exitCode: 1
items:
- image: gcr.io/kpt-fn/kubeval:unstable
- image: gcr.io/kpt-fn/kubeval:v0.2
exitCode: 1
results:
- message: Additional property templates is not allowed
Expand Down
6 changes: 3 additions & 3 deletions examples/kubeval-imperative/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ validate KRM resources.
Get the example package by running the following commands:

```shell
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/kubeval-imperative
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/kubeval-imperative@kubeval/v0.2
```

We have a `ReplicationController` in `app.yaml` that has 2 schema violations:
Expand All @@ -23,7 +23,7 @@ Try it out by running the following command:

```shell
# We set `strict=true` to disallow unknown field and `skip_kinds=MyCustom,MyOtherCustom` to skip 2 kinds that we don't have schemas.
$ kpt fn eval kubeval-imperative --image gcr.io/kpt-fn/kubeval:unstable --results-dir /tmp -- strict=true skip_kinds=MyCustom,MyOtherCustom
$ kpt fn eval kubeval-imperative --image gcr.io/kpt-fn/kubeval:v0.2 --results-dir /tmp -- strict=true skip_kinds=MyCustom,MyOtherCustom
```

The key-value pair(s) provided after `--` will be converted to `ConfigMap` by
Expand All @@ -40,7 +40,7 @@ metadata:
name: fnresults
exitCode: 1
items:
- image: gcr.io/kpt-fn/kubeval:unstable
- image: gcr.io/kpt-fn/kubeval:v0.2
exitCode: 1
results:
- message: Additional property templates is not allowed
Expand Down
2 changes: 1 addition & 1 deletion examples/kubeval-mount-schema/.expected/exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

set -eo pipefail

kpt fn eval -i gcr.io/kpt-fn/kubeval:unstable --image-pull-policy never \
kpt fn eval -i gcr.io/kpt-fn/kubeval:v0.2 --image-pull-policy never \
--mount type=bind,src="$(pwd)/jsonschema",dst=/schema-dir/master-standalone \
-- schema_location=file:///schema-dir
6 changes: 3 additions & 3 deletions examples/kubeval-mount-schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ with [`kubeval`] function to validate KRM resources.
Get the example package by running the following commands:

```shell
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/kubeval-mount-schema
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/kubeval-mount-schema@kubeval/v0.2
```

We have a `ReplicationController` in `replicationcontroller.yaml` that has a
Expand All @@ -39,7 +39,7 @@ $ openapi2jsonschema --stand-alone --expanded --kubernetes -o jsonschema path/to
We can invoke function with the following command:

```shell
$ kpt fn eval kubeval-mount-schema -i gcr.io/kpt-fn/kubeval:unstable --results-dir /tmp \
$ kpt fn eval kubeval-mount-schema -i gcr.io/kpt-fn/kubeval:v0.2 --results-dir /tmp \
--mount type=bind,src="$(pwd)/kubeval-mount-schema/jsonschema",dst=/schema-dir/master-standalone \
-- schema_location=file:///schema-dir
```
Expand All @@ -61,7 +61,7 @@ metadata:
name: fnresults
exitCode: 1
items:
- image: gcr.io/kpt-fn/kubeval:unstable
- image: gcr.io/kpt-fn/kubeval:v0.2
exitCode: 1
results:
- message: 'Invalid type. Expected: [integer,null], given: string'
Expand Down
2 changes: 1 addition & 1 deletion examples/kubeval-simple/.expected/results.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: fnresults
exitCode: 1
items:
- image: gcr.io/kpt-fn/kubeval:unstable
- image: gcr.io/kpt-fn/kubeval:v0.2
exitCode: 1
results:
- message: Additional property templates is not allowed
Expand Down
2 changes: 1 addition & 1 deletion examples/kubeval-simple/Kptfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: example
pipeline:
validators:
- image: gcr.io/kpt-fn/kubeval:unstable
- image: gcr.io/kpt-fn/kubeval:v0.2
configMap:
strict: 'true'
skip_kinds: MyCustom
6 changes: 3 additions & 3 deletions examples/kubeval-simple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ validate KRM resources.
Get the example package by running the following commands:

```shell
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/kubeval-simple
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/kubeval-simple@kubeval/v0.2
```

The following is the `Kptfile` in this example:
Expand All @@ -22,7 +22,7 @@ metadata:
name: example
pipeline:
validators:
- image: gcr.io/kpt-fn/kubeval:unstable
- image: gcr.io/kpt-fn/kubeval:v0.2
configMap:
strict: 'true'
```
Expand Down Expand Up @@ -51,7 +51,7 @@ metadata:
name: fnresults
exitCode: 1
items:
- image: gcr.io/kpt-fn/kubeval:unstable
- image: gcr.io/kpt-fn/kubeval:v0.2
exitCode: 1
results:
- message: Additional property templates is not allowed
Expand Down
8 changes: 4 additions & 4 deletions functions/ts/kubeval/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ image: gcr.io/kpt-fn/kubeval
description: Use kubeval to validate KRM resources against their json schemas.
tags:
- validator
sourceURL: https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/master/functions/ts/kubeval
sourceURL: https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/kubeval/v0.2/functions/ts/kubeval
examplePackageURLs:
- https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/master/examples/kubeval-simple
- https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/master/examples/kubeval-imperative
- https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/master/examples/kubeval-mount-schema
- https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/kubeval/v0.2/examples/kubeval-simple
- https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/kubeval/v0.2/examples/kubeval-imperative
- https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/kubeval/v0.2/examples/kubeval-mount-schema
emails:
- kpt-team@google.com
license: Apache-2.0

0 comments on commit ddbd9dd

Please sign in to comment.