Skip to content

All nine cluster policies use the deprecated spec.validationFailureAction #3149

Description

@devantler

🤖 Generated by the Agentic Engineer

Evidence

Raised by CodeRabbit on platform#2718. Kyverno has deprecated the top-level spec.validationFailureAction (and spec.validationFailureActionOverrides) in favour of the per-rule spec.rules[].validate.failureAction.

All 9 ClusterPolicies under k8s/bases/infrastructure/cluster-policies/best-practices/ use the deprecated top-level form, including restrict-tenant-issuer-refs.yaml, which merged to main recently. Zero use the current form.

Problem and audience

Nothing is broken today — the field still works on the pinned engine (1.18.2 in both ci.yaml's action-install-cli and the kyverno HelmRelease). The exposure is a future Kyverno bump: if the field is removed rather than merely warned on, every policy in the repo stops enforcing at once, and the failure mode is the one this repo has already been bitten by — an Enforce policy that silently protects nothing rather than a loud error.

Deliberately not fixed in platform#2718: converting one policy of nine would leave the directory inconsistent for no safety gain, and the migration wants to move together with a version bump.

Expected behaviour

All nine policies use the current per-rule validate.failureAction, migrated in one change alongside (or ahead of) the next Kyverno bump.

Acceptance criteria

  • All nine policies converted; no spec.validationFailureAction remains under cluster-policies/.
  • The existing kyverno test ./tests fixtures still pass, with every asserted row reporting REASON=Ok (see kyverno test cannot fail for a policy that matches nothing — Excluded rows satisfy any expectation #3145 — the suite currently cannot fail for a policy that matches nothing, so the row reasons are the real check here).
  • The Kubescape compliance gate score is unchanged.
  • Bump ci.yaml's pinned CLI and the HelmRelease together, per the comment in ci.yaml.

Size

Small but wide — nine mechanical edits plus one verification pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status
    📥 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions