Skip to content
Snippets Groups Projects
Commit 83ea2694 authored by Brandon Booker's avatar Brandon Booker
Browse files

PLATFORM-2481 - allow prometheus-operator to modify deployments and stateful...

PLATFORM-2481 - allow prometheus-operator to modify deployments and stateful sets in tenant namespaces

Changelog: updated
parent 95f49f85
1 merge request!79PLATFORM-2481 - allow prometheus-operator to modify deployments and stateful...
Pipeline #863837 passed with stages
in 30 seconds
apiVersion: v2
name: constraint-templates
version: 1.6.1
version: 1.6.2
appVersion: 1.0.0
......@@ -3,6 +3,7 @@ package allow_rollout_restart_deployment
# 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"
not input.review.userInfo.username == "system:serviceaccount:platform-prometheus-stack:prometheus-kube-prometheus-operator"
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")
......
......@@ -3,6 +3,7 @@ package allow_rollout_restart_statefulset
# Violation caused when user is not local flux, not the stakater-reloader, and not in the admin group, trying to use UPDATE to change a StatefulSet. 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"
not input.review.userInfo.username == "system:serviceaccount:platform-prometheus-stack:prometheus-kube-prometheus-operator"
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")
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment