Skip to content

helm-release-enable-tests policy is never ready because its match covers every resource #6135

Closed

Description

@devantler

🤖 Generated by the Agentic Engineer

Evidence

A read-only check of prod on 2026-11-12 found the helm-release-enable-tests MutatingPolicy at ready: false since it was created on 2026-10-26. Its RBACPermissionsGranted condition says Kyverno's reports controller lacks get, list and watch on every resource (*/*). The mutation itself works: 7 of 49 HelmReleases carry the opt-in label and all 7 have tests enabled.

The cause is the policy's deliberately broad match (apiGroups, resources and apiVersions all *, narrowed to HelmRelease only by a CEL condition). Kyverno wants read access to everything the match names before it will report on the policy.

Problem

A policy that is never ready produces no reports, so the posture tooling cannot show whether it applied. It also makes ready: false normal in the cluster, which hides a policy that is not ready for a real reason (as restrict-tenant-image-repositories was in #6080).

Hypothesis and success signal

Matching only helm.toolkit.fluxcd.io helmreleases (all served versions) keeps the mutation identical and lets the policy become ready with the reports controller's existing grants. Success: the policy reports ready: true, the existing Kyverno CLI test still passes, and the 7 opted-in HelmReleases still have tests enabled after the next reconcile.

Acceptance criteria

  • The match names only HelmReleases, without widening the reports controller's permissions.
  • The existing chainsaw or Kyverno CLI tests for this policy pass, including the label-removed case.
  • Prod shows ready: true for the policy after deploy, read back read-only.

Rough size: small. Related: #4997, #5357.

Activity

  1. added theissue type on Nov 12, 2026
  2. moved this to 📥 Backlog in 🌊 Project Boardon Nov 12, 2026
  3. coderabbitai commented on Nov 12, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #5360 - refactor(policy): preserve Helm release defaults on CEL policies [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  4. added 2 commits that reference this issue on Nov 12, 2026
  5. moved this from 📥 Backlog to 🏃🏻‍♂️ In Progress in 🌊 Project Boardon Nov 12, 2026
  6. moved this from 🏃🏻‍♂️ In Progress to ✅ Done in 🌊 Project Boardon Nov 12, 2026
  7. devantler commented on Nov 12, 2026

    @devantler
    ContributorAuthor

    🤖 Generated by the Agentic Engineer

    Delivered and verified in production. #6140 merged as 3dbd0347000a01bb17cb67cc713c6d24ae71ce30 through the merge queue, whose run deployed it to prod (run 43299132983). Read back read-only at about 21:08 UTC:

    Check Result
    helm-release-enable-tests Generation 2, matches helm.toolkit.fluxcd.io/helmreleases, ready: true, RBACPermissionsGranted=True
    helm-release-remediation-retries Generation 2, same match, ready: true, RBACPermissionsGranted=True
    helm-release-install-crds Unchanged, still ready
    Kyverno's mutating webhook for each policy Now registered for HelmReleases only, instead of every resource
    Test opt-ins outside kube-system and kyverno 7 of 7 have spec.test.enable: true
    Remediation opt-ins outside those namespaces 38 of 38 have retries 3 and remediateLastFailure on install and upgrade

    Eight more releases carry an opt-in label but not the defaults: cilium, descheduler, hcloud-cloud-controller-manager, hcloud-csi, metrics-server, snapshot-controller, tetragon and kyverno. All live in kube-system or kyverno. Kyverno's webhooks exclude both namespaces for all three Helm release defaults, the unchanged install-crds policy included, so those releases were never mutated, before this change or after it. Their own manifests set the values they run with (for example, unlimited install retries).

    All three acceptance criteria are met:

    • The match names only HelmReleases, with no change to the reports controller's access.
    • The CLI tests, including the label-removed cases, pass.
    • Prod shows ready: true for both policies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions