-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update simple Kubernetes deployment example #1343
Update simple Kubernetes deployment example #1343
Conversation
input.kind == "Pod" | ||
container := input.spec.containers[_] | ||
not re_match("^registry.acmecorp.com/.+$", container.image) | ||
deny["Invalid image registry"] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the goal is to show just OPA and not relate it to the admission controller should we change the policy to not look like the admission requests at all? The changes made are substantial if you know what the admission requests look like, but the policy is still showing the same sort of behavior.
Maybe we just show the same example as the docker one earlier in that page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thought crossed my mind at the time. I've updated it to avoid lingering confusion. LMKWYT.
deny { | ||
not input.metadata.labels.customer | ||
deny["Missing customer label"] { | ||
not input.tags.customer | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be useful to also show a rule that returns a true/false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The policy now matches the Docker example above. If we want to include true/false examples here, we could come back and add it later. Not sure it's required though.
Fixes open-policy-agent#874 Signed-off-by: Torin Sandall <torinsandall@gmail.com>
a74f5bf
to
4cecfb8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #874
Signed-off-by: Torin Sandall torinsandall@gmail.com