Skip to content

Commit

Permalink
fix: use newer seccompProfile spec in mutation (#599)
Browse files Browse the repository at this point in the history
Older is ignored

Signed-off-by: Mathieu Parent <[email protected]>
Co-authored-by: Rita Zhang <[email protected]>
  • Loading branch information
sathieu and ritazh authored Oct 29, 2024
1 parent af24955 commit da229ba
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
19 changes: 11 additions & 8 deletions mutation/pod-security-policy/seccomp/samples/mutation.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
apiVersion: mutations.gatekeeper.sh/v1
kind: AssignMetadata
kind: Assign
metadata:
name: k8spspseccomp
spec:
match:
scope: Namespaced
kinds:
- apiGroups: [""]
kinds: ["Pod"]
location: metadata.annotations."seccomp.security.alpha.kubernetes.io/pod"
applyTo:
- groups: [""]
kinds: ["Pod"]
versions: ["v1"]
location: spec.securityContext.seccompProfile
parameters:
pathTests:
- subPath: spec.securityContext.seccompProfile
condition: MustNotExist
assign:
value: runtime/default
value:
type: RuntimeDefault
19 changes: 11 additions & 8 deletions website/docs/mutation-examples/seccomp.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper-
## Mutation Examples
```yaml
apiVersion: mutations.gatekeeper.sh/v1
kind: AssignMetadata
kind: Assign
metadata:
name: k8spspseccomp
spec:
match:
scope: Namespaced
kinds:
- apiGroups: [""]
kinds: ["Pod"]
location: metadata.annotations."seccomp.security.alpha.kubernetes.io/pod"
applyTo:
- groups: [""]
kinds: ["Pod"]
versions: ["v1"]
location: spec.securityContext.seccompProfile
parameters:
pathTests:
- subPath: spec.securityContext.seccompProfile
condition: MustNotExist
assign:
value: runtime/default
value:
type: RuntimeDefault

```

0 comments on commit da229ba

Please sign in to comment.