This commit is contained in:
2026-04-14 15:12:46 +07:00
parent dce89d417f
commit 0860207806
3 changed files with 29 additions and 2 deletions
@@ -32,3 +32,20 @@ spec:
audit.company.com/created-at: "{{ time_now_utc() }}"
audit.company.com/user-groups: >-
{{ request.userInfo.groups | join(', ', @) }}
- name: set-environment-labels
match:
resources:
kinds:
- Pod
context:
- name: namespaceConfig
apiCall:
urlPath: "/api/v1/namespaces/{{ request.object.metadata.namespace }}"
jmesPath: "metadata.labels"
mutate:
patchStrategicMerge:
metadata:
labels:
+(environment): "{{ namespaceConfig.environment || 'unknown' }}"
+(team): "{{ namespaceConfig.team || 'platform' }}"