Skip to content

Preserve the ARC retirement fence while migrating it to ValidatingPolicy #5834

Open

Description

@devantler

🤖 Generated by the Agentic Engineer

Evidence

Audience and problem

Whoever retires or recovers the ARC runner pool. The fence is what stops a Flux reconcile or a manual apply from recreating the release, or reopening runner admission, while a retirement is in progress. A migration that changes its decision even in one phase either blocks a legitimate recovery step or lets a retired pool come back. The existing cases feed the Namespace through a JMESPath apiCall context. A ValidatingPolicy reads it through CEL resource.Get instead, so the harness must give the new kind the same Namespace responses, or the old expectations prove nothing about it.

Hypothesis

If the existing engine cases run unchanged in their expected results against a ValidatingPolicy that reads the Namespace through CEL resource.Get, with the same Namespace responses supplied to it, then any decision the rewrite changes shows up as a failing case before deploy, not as a blocked recovery.

Success signal

  • scripts/tests/test-arc-retirement-fence.sh and the test(kyverno): pin the ARC listener and retirement policies before their ValidatingPolicy rewrite #5031 fixtures pass against the new kind with unchanged expected results, and a deliberate mutation of the new policy turns at least one case red (the harness is not vacuous for the new kind).
  • The ValidatingPolicy passes the same test unchanged in its expected results, keeps Deny, the same match scope and failurePolicy: Fail, and replaces the ClusterPolicy in the same PR.
  • After deploy, a read-only check shows the new policy ready and no ClusterPolicy of that name.

Guardrail: an unreadable Namespace must still deny (fail closed), as it does today through failurePolicy: Fail.

Smallest useful change

  1. Spike: confirm how the pinned Kyverno CLI (1.19.2) supplies a Namespace to a ValidatingPolicy's resource.Get (the apiCallResponses mechanism, or another context input), and how request.oldObject and user groups reach it. Record the answer here.
  2. Migration PR: the ValidatingPolicy and deletion of the ClusterPolicy, with the same tests pointed at the new kind.

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