feat: add label-based exclusion to inject-coco-initdata policy#92
Open
butler54 wants to merge 1 commit into
Open
feat: add label-based exclusion to inject-coco-initdata policy#92butler54 wants to merge 1 commit into
butler54 wants to merge 1 commit into
Conversation
Add exclude block to inject-coco-initdata Kyverno policy to skip pods with label coco.io/skip-initdata: "true". This allows special-purpose kata pods (like firmware collection pods) to bypass init_data injection when they don't need attestation to KBS. Use case: The firmware collection workflow (PR validatedpatterns#89) needs to launch a kata pod to collect TEE measurements using veritas, but doesn't require init_data injection since it only accesses the TEE device directly and doesn't request secrets from KBS. Without this exclusion, the policy tries to inject init_data but fails because the pod doesn't have the coco.io/initdata-configmap annotation, blocking pod creation. Usage: Add label coco.io/skip-initdata: "true" to any kata pod that should bypass init_data injection. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Kyverno's
inject-coco-initdatapolicy currently has no exclusion mechanism. All kata pods must have thecoco.io/initdata-configmapannotation, or the policy fails when trying to read the (non-existent) ConfigMap.This blocks special-purpose kata pods that don't need init_data injection, such as:
Solution
Add an
excludeblock to the policy that skips pods with labelcoco.io/skip-initdata: "true".Changes
Usage
Special-purpose kata pods can bypass init_data injection by adding the label:
Benefits
Related
mutation policy inject-coco-initdata error: failed to evaluate preconditions: failed to substitute variables in condition keyTesting
Deploy the updated policy, then launch a kata pod with
coco.io/skip-initdata: "true"label:🤖 Generated with Claude Code