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:
If you provide 2 constraints with the same metadata.name and same spec.match but with different spec.enforcementActions, then the return code is either 0 or 1.
We expect the label to be allowed and the name to be denied, but since K8sDenyName.default enforcement action is warn then gator should return 0, not 1.
But it's not always the case:
$> for i in $(seq 10); do gator test -f resources.yaml; echo "return: $?"; done v1/Namespace policy-violation: ["default"] Message: "The name policy-violation is not allowed"return: 1v1/Namespace policy-violation: ["default"] Message: "The name policy-violation is not allowed"return: 1v1/Namespace policy-violation: ["default"] Message: "The name policy-violation is not allowed"return: 1v1/Namespace policy-violation: ["default"] Message: "The name policy-violation is not allowed"return: 1v1/Namespace policy-violation: ["default"] Message: "The name policy-violation is not allowed"return: 1v1/Namespace policy-violation: ["default"] Message: "The name policy-violation is not allowed"return: 0v1/Namespace policy-violation: ["default"] Message: "The name policy-violation is not allowed"return: 1v1/Namespace policy-violation: ["default"] Message: "The name policy-violation is not allowed"return: 1v1/Namespace policy-violation: ["default"] Message: "The name policy-violation is not allowed"return: 1v1/Namespace policy-violation: ["default"] Message: "The name policy-violation is not allowed"return: 0
What did you expect to happen:
Gator should return always return 0 in this case.
Anything else you would like to add:
If the constraint names are different, it works as expected.
What steps did you take and what happened:
If you provide 2 constraints with the same
metadata.name
and samespec.match
but with differentspec.enforcementActions
, then the return code is either0
or1
.For example, given the following resources:
We expect the
label
to be allowed and thename
to be denied, but sinceK8sDenyName.default
enforcement action iswarn
then gator should return0
, not1
.But it's not always the case:
What did you expect to happen:
Gator should return always return
0
in this case.Anything else you would like to add:
If the constraint names are different, it works as expected.
Environment:
kubectl version
): NAThe text was updated successfully, but these errors were encountered: