← Back to Pull requests

CNTRLPLANE-4463: stop PSA label syncer on an enabled or missing gate #215

Open
unknown opened this pull request with 343 lines diff across 4 files
View on GitHub
unknown unknown commented on Nov 12, 2026 23:14 UTC
Author

OpenShift and HyperShift stop writing enforce labels, even during an upgrade or a rollback. MicroShift keeps them.

Part of openshift/enhancements#2169 (CNTRLPLANE-4463).

| feature gates passed | before | after |
| ------------------------------------- | --------- | ----------- |
| none (MicroShift) | enforcing | enforcing |
| OpenShiftPodSecurityAdmission=false | advising | advising |
| OpenShiftPodSecurityAdmission=true | enforcing | not started |
| gate not listed | enforcing | not started |

Why: during an upgrade or a rollback, cluster-policy-controller can start with the feature gates of another release. Today everything except =false enforces, so an enabled gate, or one already removed from openshift/api, brings enforce labels back. MicroShift passes no feature gates at all, while OpenShift and HyperShift pass every gate, enabled or disabled. Therefore an empty list is the only safe signal for MicroShift.

Commits: the behaviour change, then a no-op extraction of psaLabelSyncerModeFor with a table test, then docs. A unit test is the only way to cover "gate not listed", as no cluster sends such a list while openshift/api declares the gate.

Merge order: the gate is enabled on TechPreviewNoUpgrade and DevPreviewNoUpgrade. There, KAS-O and the HyperShift CPO still enforce restricted cluster-wide and rely on the syncer's enforce labels to relax namespaces:

  • cluster-kube-apiserver-operator podsecurityadmission.go#L100-L108

  • hypershift kas/config.go#L188-L192
  • Those have to change first. Otherwise new namespaces on those clusters get restricted, whatever SCCs their service accounts may use.

    /hold

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Documentation
    Clarified how PSA label synchronization varies by feature-gate state, including when it synchronizes enforce, warn, and audit labels, synchronizes only warn and audit labels, or is disabled.
    Bug Fixes
    Updated the controller’s behavior to match the documented feature-gate modes: it no longer starts when the gate is enabled or unspecified.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 343 lines (+257 / -86) across 4 files Reviewer: liouk Review duration: 28857m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.42) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 343 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    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.349
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #215"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% 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: 42.3% (MEDIUM) · Higher = larger blast radius
    42.3%
    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: 43.0% · Lower = rushed or shallow review
    43.0%
    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: 24.1% · Safe to merge
    24.1%