You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps did you take and what happened:
I am using gatekeeper's vap / vapb integration to reflect vap / vapb in the cluster. I'm trying to use gator to test the constraint / template resources for creating vap / vapb, but the tests are behaving differently than expected, possibly because enforcementAction is not being parsed correctly.
All the manifests and procedures of the constraintTemplate follow the demo.
and the manifests for various suites executed by gator are as follows:
=== RUN all-must-have-owner
=== RUN allowed-ns
--- PASS: allowed-ns (0.007s)
=== RUN error-ns
--- PASS: error-ns (0.004s)
--- PASS: all-must-have-owner (0.026s)
ok ./manifests/validating-admission-policy/test/suite.yaml 0.026s
PASS
What did you expect to happen:
enforcementAction is correctly interpreted and the test is executed.
Anything else you would like to add:
I verified the issue locally using three methods:
Installing gator via go install: go install github.com/open-policy-agent/gatekeeper/v3/cmd/gator@v3.18.2 && gator verify *
@mmmommm This is because gator.gatekeeper.sh enforcementPoint is not included in constraint, here is where you can find out more about gator enforcementPoint - https://open-policy-agent.github.io/gatekeeper/website/docs/enforcement-points/#deny-in-shift-left-and-warn-at-admission.
Removing scoped enforcement action means enforcing all enforcement points, it will result in enforcing constraints through gator. gator-cli only looks for constraint with gator.gatekeeper.sh enforcement point -
What steps did you take and what happened:
I am using gatekeeper's vap / vapb integration to reflect vap / vapb in the cluster. I'm trying to use gator to test the constraint / template resources for creating vap / vapb, but the tests are behaving differently than expected, possibly because enforcementAction is not being parsed correctly.
All the manifests and procedures of the constraintTemplate follow the demo.
and the manifests for various suites executed by gator are as follows:
demo/scoped-enforcement-actions/suite.yaml
demo/scoped-enforcement-actions/testdata/error-ns.yaml:
demo/scoped-enforcement-actions/testdata/success-ns.yaml:
The command to run gator is:
gator verify -v demo/scoped-enforcement-actions/suite.yaml
The result is following violations is not occur:
When commenting out enforcementAction: scoped in owner_must_be_provided_usevap.yaml and running again, the result is:
What did you expect to happen:
enforcementAction is correctly interpreted and the test is executed.
Anything else you would like to add:
I verified the issue locally using three methods:
Installing gator via go install:
go install github.com/open-policy-agent/gatekeeper/v3/cmd/gator@v3.18.2 && gator verify *
Install via brew:
Using a Docker container:
docker run ghcr.io/open-policy-agent/gator:v3.18.2 verify *
In all three cases, the issue was reproducible.
Environment:
kubectl version
):The text was updated successfully, but these errors were encountered: