Skip to content

Commit

Permalink
Updated gatekeeper to 3.10 (#192)
Browse files Browse the repository at this point in the history
* Updated gatekeeper to 3.10

* removed dead patch commands

* fixed error message checking

* fixed running on ocp 4.12

* Update _test/deploy-gatekeeper.sh

Co-authored-by: Petter Abrahamsson <pabraham@redhat.com>

---------

Co-authored-by: Petter Abrahamsson <pabraham@redhat.com>
  • Loading branch information
garethahealy and pabrahamsson authored Mar 1, 2023
1 parent 70cf8af commit 82b0372
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 84 deletions.
6 changes: 3 additions & 3 deletions _test/deploy-gatekeeper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ shopt -s inherit_errexit
command -v oc &> /dev/null || { echo >&2 'ERROR: oc not installed - Aborting'; exit 1; }
command -v konstraint &> /dev/null || { echo >&2 'ERROR: konstraint not installed - Aborting'; exit 1; }

gatekeeper_version="v3.7.0"
gatekeeper_version="v3.10.0"

cleanup_gatekeeper_constraints() {
echo ""
Expand Down Expand Up @@ -53,8 +53,8 @@ deploy_gatekeeper() {
oc create clusterrole gatekeeper-allow-anyuid-scc --verb=use --resource=securitycontextconstraints.security.openshift.io --resource-name=anyuid
oc create rolebinding gatekeeper-anyuid-scc --serviceaccount=gatekeeper-system:gatekeeper-admin --clusterrole=gatekeeper-allow-anyuid-scc -n gatekeeper-system

oc patch Deployment/gatekeeper-audit --type json -p='[{"op": "remove", "path": "/spec/template/metadata/annotations/container.seccomp.security.alpha.kubernetes.io~1manager"}]' -n gatekeeper-system
oc patch Deployment/gatekeeper-controller-manager --type json -p='[{"op": "remove", "path": "/spec/template/metadata/annotations/container.seccomp.security.alpha.kubernetes.io~1manager"}]' -n gatekeeper-system
oc patch deployment/gatekeeper-audit --type json -p='[{"op": "remove", "path": "/spec/template/spec/containers/0/securityContext/runAsUser"}]' -n gatekeeper-system
oc patch deployment/gatekeeper-controller-manager --type json -p='[{"op": "remove", "path": "/spec/template/spec/containers/0/securityContext/runAsUser"}]' -n gatekeeper-system

echo ""
echo "Patching gatekeeper to enable emit-admission-events..."
Expand Down
Loading

0 comments on commit 82b0372

Please sign in to comment.