Skip to content
Snippets Groups Projects

hoffmanm-PLATFORM-2424-permit-stakater-reloads

Merged Morgan Hoffman requested to merge hoffmanm-PLATFORM-2176-permit-stakater-reloads into master
Compare and
5 files
+ 23
3
Compare changes
  • Side-by-side
  • Inline
Files
5
package allow_rollout_restart
# Violation caused when user is not flux and not in the admin group, trying to use UPDATE to change a DEPLOYMENT. The old annotations get patched with a value to build the datastructure, but it gets removed in the next step, so the value is innocuous.
# Violation caused when user is not the local flux, nor stakater-reloader, and not in the admin group, trying to use UPDATE to change a DEPLOYMENT. The old annotations get patched with a value to build the datastructure, but it gets removed in the next step, so the value is innocuous.
violation[{"msg": msg}] {
not input.review.userInfo.username == "system:serviceaccount:platform-stakater-reloader:stakater-reloader"
flux_username := concat("",["system:serviceaccount:",input.review.namespace,":flux"])
not input.review.userInfo.username == flux_username
not contains(input.review.userInfo.groups, "oidc:it.platform.roles.admin")