← Back to Pull requests

Support kmsKey.version rotation #5629

Closed
unknown closed this pull request without merging on Jul 22, 2026 14:42 UTC
View on GitHub
unknown unknown commented on Jun 12, 2026 11:53 UTC
Author

https://redhat.atlassian.net/browse/ARO-27470
https://redhat.atlassian.net/browse/ARO-27471

What

Makes KmsKey.Version updatable via PATCH in the v20260630preview API so that customers can rotate their etcd encryption key version without recreating the cluster.

Why

Customers using customer-managed encryption for etcd need to rotate their KMS key version periodically (security policy, key expiry, compliance). Today, all KMS fields — including version — are immutable after cluster creation. This forces a destructive cluster recreate just to update a key version, which is operationally unacceptable.

This PR is the RP-side half of the feature. Cluster Service is being updated separately to accept KMS key version changes on its PATCH endpoint. Both sides must be in place for end-to-end rotation to work, but neither breaks independently — the RP will send the version, and CS will either accept it (if updated) or ignore it (if not yet updated).

This PR has the changes for the ARM API spec and the frontend changes and adds E2E tests.

Testing

Unit tests:

  • Validation: "mutable kms key version" test verifies version-only change passes; "immutable kms visibility" expected errors updated to reflect removed parent-level guards

  • Admission: 4 new test cases covering version-gated rotation at 4.21, 4.22, during upgrade, and no-change

  • OCM conversion: "UPDATE - sends KMS key version" test verifies etcd encryption appears in the CS builder on update; getBaseCSClusterBuilder(true) updated to include default PlatformManaged etcd for update expectations
  • Manual verification: PATCH with key version change tested against dev environment confirming CS accepts the update and other fields remain unchanged.

    E2E tests:
    Added a simple E2E test that rotates the key version once and then disables the old key.
    The test has a timebomb on the APIVersion being used. So it should be OK to merge, environments that doesn't have this API version will not use this test.
    Example can be found in latest prod jobs https://prow.ci.openshift.org/view/gs/test-platform-results/logs/periodic-ci-Azure-ARO-HCP-main-periodic-prod-e2e-parallel/2075037316002353152
    Where the test Customer should create a cluster using the 2026-06-30-preview API version is skipped.

    Special notes for your reviewer

  • The @renamedFrom suffix (NoUpdate) is a TypeSpec convention for this pattern — it doesn't appear in the generated API surface. The generated OpenAPI spec and SDK models are unchanged for older API versions. Verify this by checking that internal/api/v20240610preview/generated/ and internal/api/v20251223preview/generated/ are unmodified.
  • KMS key version rotation requires HyperShift changes that only land in OpenShift >= 4.22. The admission controller rejects key version changes when the cluster's lowest active control plane version is below 4.22. Why lowest and not requested? During a rolling upgrade, a cluster can have multiple active control plane versions (e.g. 4.22 + 4.23). Using the lowest ensures the rotation is only allowed when all active components support it.

    PR Checklist


  • PR is scoped to a single task (no mixed concerns)

  • Title follows Conventional Commits format

  • Summary explains the "Why" behind the change

  • Linked to relevant ticket/issue

  • Self-reviewed the diff

  • CI/CD checks are passing (ignore Tide)

  • Commit history is clean (rebased/squashed)

  • Tricky code blocks are commented

  • Specific reviewers tagged

  • All comment threads resolved before merge
  • Requirements to merge this change


  • CS rolled out to production

  • CPO override with the fix https://github.com/openshift/hypershift/pull/9010 merged

  • New HO image is deployed in ARO-HCP https://github.com/Azure/ARO-HCP/pull/6161
  • Diff: 491 lines (+368 / -123) across 6 files Reviewer: ahitacat Review duration: 57769m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 491 lines diff across 6 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.371
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #5629"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.4% (MEDIUM) · Higher = larger blast radius
    47.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.7% · Safe to merge
    18.7%
    Repository