Skip to content

Commit e975da1

Browse files
author
Mengqi Yu
authored
update for gatekeeper/v0.2 branch (#514)
1 parent e172cad commit e975da1

File tree

12 files changed

+27
-27
lines changed

12 files changed

+27
-27
lines changed

examples/gatekeeper-disallow-root-user/.expected/results.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: fnresults
55
exitCode: 1
66
items:
7-
- image: gcr.io/kpt-fn/gatekeeper:unstable
7+
- image: gcr.io/kpt-fn/gatekeeper:v0.2
88
stderr: |
99
[error] apps/v1/Deployment/nginx-deploy : Containers must not run as root
1010
violatedConstraint: disallowroot

examples/gatekeeper-disallow-root-user/Kptfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ metadata:
44
name: example
55
pipeline:
66
validators:
7-
- image: gcr.io/kpt-fn/gatekeeper:unstable
7+
- image: gcr.io/kpt-fn/gatekeeper:v0.2

examples/gatekeeper-disallow-root-user/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ enforce the policy `Containers must not run as root` on resources.
1010
Get the example package by running the following commands:
1111

1212
```shell
13-
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/gatekeeper-disallow-root-user
13+
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/gatekeeper-disallow-root-user@gatekeeper/v0.2
1414
```
1515

1616
There are 3 resources: a `ConstraintTemplate`, a `DisallowRoot` and
@@ -81,7 +81,7 @@ metadata:
8181
name: fnresults
8282
exitCode: 1
8383
items:
84-
- image: gcr.io/kpt-fn/gatekeeper:unstable
84+
- image: gcr.io/kpt-fn/gatekeeper:v0.2
8585
stderr: |-
8686
[error] apps/v1/Deployment/nginx-deploy : Containers must not run as root
8787
violatedConstraint: disallowroot
@@ -110,4 +110,4 @@ To pass validation, let's set
110110
field `spec.template.spec.securityContext.runAsNonRoot` to `true` in
111111
the `Deployment` in `resources.yaml`. Rerun the command. It will succeed.
112112

113-
[gatekeeper]: https://catalog.kpt.dev/gatekeeper/v0.1/
113+
[gatekeeper]: https://catalog.kpt.dev/gatekeeper/v0.2/

examples/gatekeeper-imperative/.expected/results.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: fnresults
55
exitCode: 1
66
items:
7-
- image: gcr.io/kpt-fn/gatekeeper:unstable
7+
- image: gcr.io/kpt-fn/gatekeeper:v0.2
88
stderr: |
99
[error] v1/ConfigMap/default/super-secret : The following banned keys are being used in the ConfigMap: {"private_key"}
1010
violatedConstraint: no-secrets-in-configmap

examples/gatekeeper-imperative/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ running [`gatekeeper`] function imperatively.
1010
Get the example package by running the following commands:
1111

1212
```shell
13-
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/gatekeeper-imperative
13+
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/gatekeeper-imperative@gatekeeper/v0.2
1414
```
1515

1616
To ensure ConfigMaps do not contain fields with name `private_key`, we express
@@ -26,7 +26,7 @@ We have a `ConfigMap` in `config-map.yaml` that violates the policy.
2626
Run the function with `--results-dir` flag:
2727

2828
```shell
29-
$ kpt fn eval gatekeeper-imperative --image gcr.io/kpt-fn/gatekeeper:unstable --results-dir /tmp
29+
$ kpt fn eval gatekeeper-imperative --image gcr.io/kpt-fn/gatekeeper:v0.2 --results-dir /tmp
3030
```
3131

3232
### Expected result
@@ -40,7 +40,7 @@ metadata:
4040
name: fnresults
4141
exitCode: 1
4242
items:
43-
- image: gcr.io/kpt-fn/gatekeeper:unstable
43+
- image: gcr.io/kpt-fn/gatekeeper:v0.2
4444
stderr: |-
4545
The following banned keys are being used in the ConfigMap: {"private_key"}
4646
violatedConstraint: no-secrets-in-configmap
@@ -72,4 +72,4 @@ To pass validation, let's replace the key `private_key` in the `ConfigMap` in
7272
`resources.yaml` with something else e.g. `public_key`. Rerun the command. It
7373
will succeed.
7474

75-
[`gatekeeper`]: https://catalog.kpt.dev/gatekeeper/v0.1/
75+
[`gatekeeper`]: https://catalog.kpt.dev/gatekeeper/v0.2/

examples/gatekeeper-invalid-configmap/.expected/results.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: fnresults
55
exitCode: 1
66
items:
7-
- image: gcr.io/kpt-fn/gatekeeper:unstable
7+
- image: gcr.io/kpt-fn/gatekeeper:v0.2
88
stderr: |
99
[error] v1/ConfigMap/default/super-secret : The following banned keys are being used in the ConfigMap: {"private_key"}
1010
violatedConstraint: no-secrets-in-configmap

examples/gatekeeper-invalid-configmap/Kptfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ metadata:
44
name: example
55
pipeline:
66
validators:
7-
- image: gcr.io/kpt-fn/gatekeeper:unstable
7+
- image: gcr.io/kpt-fn/gatekeeper:v0.2

examples/gatekeeper-invalid-configmap/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function to validate resources using gatekeeper constraints.
1010
Get the example package by running the following commands:
1111

1212
```shell
13-
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/gatekeeper-invalid-configmap
13+
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/gatekeeper-invalid-configmap@gatekeeper/v0.2
1414
```
1515

1616
There are 3 resources: a `ConstraintTemplate`, a `K8sBannedConfigMapKeysV1` and
@@ -25,7 +25,7 @@ metadata:
2525
name: example
2626
pipeline:
2727
validators:
28-
- image: gcr.io/kpt-fn/gatekeeper:unstable
28+
- image: gcr.io/kpt-fn/gatekeeper:v0.2
2929
```
3030
3131
### Function invocation
@@ -47,7 +47,7 @@ metadata:
4747
name: fnresults
4848
exitCode: 1
4949
items:
50-
- image: gcr.io/kpt-fn/gatekeeper:unstable
50+
- image: gcr.io/kpt-fn/gatekeeper:v0.2
5151
stderr: |-
5252
The following banned keys are being used in the ConfigMap: {"private_key"}
5353
violatedConstraint: no-secrets-in-configmap
@@ -78,4 +78,4 @@ To pass validation, let's replace the key `private_key` in the `ConfigMap` in
7878
`resources.yaml` with something else e.g. `public_key`.
7979
Rerun the command. It will succeed.
8080

81-
[gatekeeper]: https://catalog.kpt.dev/gatekeeper/v0.1/
81+
[gatekeeper]: https://catalog.kpt.dev/gatekeeper/v0.2/

examples/gatekeeper-warning-only/.expected/results.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: fnresults
55
exitCode: 0
66
items:
7-
- image: gcr.io/kpt-fn/gatekeeper:unstable
7+
- image: gcr.io/kpt-fn/gatekeeper:v0.2
88
exitCode: 0
99
results:
1010
- message: |-

examples/gatekeeper-warning-only/Kptfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ metadata:
44
name: example
55
pipeline:
66
validators:
7-
- image: gcr.io/kpt-fn/gatekeeper:unstable
7+
- image: gcr.io/kpt-fn/gatekeeper:v0.2

0 commit comments

Comments
 (0)