Skip to content

Commit 68457d0

Browse files
butler54claude
andcommitted
fix: target Pods only for cc_init_data injection, disable autogen
The autogen Deployment rule causes admission failures when the initdata ConfigMap hasn't been propagated to the workload namespace yet. By targeting Pods only (autogen-controllers: none), Deployments are admitted without ConfigMap resolution. Pods get cc_init_data injected at creation time when the ConfigMap is available. A rollout restart picks up new initdata values. Also removes UPDATE operation — only CREATE is needed since a rollout restart creates new Pods. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 070ca0e commit 68457d0

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

charts/all/coco-kyverno-policies/templates/inject-coco-initdata.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ metadata:
66
policies.kyverno.io/title: Inject CoCo InitData
77
policies.kyverno.io/category: Confidential Computing
88
policies.kyverno.io/severity: medium
9-
policies.kyverno.io/subject: Pod,Deployment
9+
policies.kyverno.io/subject: Pod
1010
policies.kyverno.io/description: >-
1111
Injects cc_init_data annotation into pods with a kata runtime class
1212
by reading from a ConfigMap specified via the coco.io/initdata-configmap
13-
annotation. Kyverno autogen extends this to Deployments, StatefulSets,
14-
DaemonSets, and Jobs automatically.
13+
annotation. Targets Pods only (not Deployments) so that Deployments
14+
remain stable and a rollout restart resolves the latest initdata.
1515
argocd.argoproj.io/sync-wave: "1"
16-
pod-policies.kyverno.io/autogen-controllers: Deployment,StatefulSet,DaemonSet,Job
16+
pod-policies.kyverno.io/autogen-controllers: none
1717
spec:
1818
rules:
1919
- name: inject-initdata
@@ -24,7 +24,6 @@ spec:
2424
- Pod
2525
operations:
2626
- CREATE
27-
- UPDATE
2827
preconditions:
2928
all:
3029
- key: "{{ "{{" }}request.object.spec.runtimeClassName || '' {{ "}}" }}"

0 commit comments

Comments
 (0)