Skip to content

Move the runner-pool retirement fence and its tooling to ValidatingPolicy #6216

Open

Description

@devantler

🤖 Generated by the Agentic Engineer

Evidence and problem

restrict-arc-retirement is the last of #4995's twelve validation policies that has not started its move to ValidatingPolicy before Kyverno 1.20 removes ClusterPolicy (#4984). The spike on #5834 found that the move also has to change the retirement tooling: scripts/retire-arc-pool.sh reads the live clusterpolicy restrict-arc-retirement and compares it rule by rule, and both it and scripts/retire-arc-pool/writer.go recognise a fence denial by the ClusterPolicy webhook name and its restrict-arc-retirement: / <rule>: message lines. A ValidatingPolicy denial instead reads Policy restrict-arc-retirement failed: <message> from the vpol.validate.kyverno.svc webhook family, with no rule name.

Who it affects

The platform operator: if the policy moves without the tooling, a real runner-pool retirement would be refused by its own tooling; if it moves without its cases, a Flux change could quietly re-create the retired pool or its credentials.

Hypothesis

If the replacement ValidatingPolicy is held to the existing cases unchanged (through the driver from #6215), every validation's message names the old rule it replaces, and the tooling reads the new kind and denial format, the ClusterPolicy can be deleted in the same change with no change in what is allowed or refused.

Acceptance criteria

  • Each of the eight rules has an equivalent validation with the same failure action and the same fail-closed behaviour when the Namespace cannot be read; each message names its old rule.
  • The existing ~75 engine cases and the tests/restrict-arc-retirement-* fixtures pass against the replacement with unchanged expected results.
  • scripts/retire-arc-pool.sh, scripts/retire-arc-pool/writer.go and their contract test read the ValidatingPolicy and its denial format.
  • tests/policy-failure-actions.json and the fixture-evaluation self-test are updated; the ClusterPolicy is deleted in the same PR.
  • After deploy, a read-only check shows the ValidatingPolicy ready and the ClusterPolicy gone; the result is recorded on Migrate the tenant and organisation validation ClusterPolicies to ValidatingPolicy #4995.

Size

Medium to large.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions