← Back to Pull requests

fix(tls): fail closed when TLS profile watcher cannot register #176

Closed
unknown closed this pull request without merging on Sep 29, 2026 13:54 UTC
View on GitHub
unknown unknown commented on Sep 02, 2026 11:42 UTC
Author

Purpose of this PR

If ProfileWatcher.SetupWithManager fails, the operator previously logged a warning and kept running. Cluster TLS profile changes then never trigger a restart, so the process can serve with a stale profile.

This matches the fail-closed pattern used by opendatahub-operator, mlflow-operator, and DSPO.

Follow-up to #156.

Proposed changes:

  • SetupProfileWatcherRestart now returns an error when watcher registration fails (and cancels the context)

  • Controller and webhook entry points call os.Exit(1) on that error so kubelet restarts the process
  • Change Category

  • Bugfix (non-breaking change which fixes an issue)

  • Feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that could affect existing functionality)

  • Documentation update
  • Rationale

    Log-and-continue on watcher registration is inconsistent with the org TLS contract: if the watcher never starts, the operator cannot honor cluster TLS profile changes.

    Checklist

  • I have conducted a self-review of my own code.

  • I have updated documentation accordingly.

  • I have added tests that prove my changes are effective or that my feature works.

  • Existing unit tests pass locally with my changes.
  • Additional Notes

  • go test ./pkg/tls/... and go build ./cmd/operator/... pass locally

  • Related: RHOAIENG-75229
  • Made with Cursor

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

    Summary by CodeRabbit

    Bug Fixes
    Improved startup reliability for the operator controller and webhook.
    TLS security profile watcher setup failures are now detected and reported immediately.
    Components stop startup when the TLS watcher cannot be initialized, preventing operation with an invalid or unavailable security context.
    TLS settings are now consistently applied to REST-based submissions.
    Failed watcher initialization no longer leaves components running with a partially configured security context.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 264 lines (+198 / -66) across 3 files Reviewer: RobuRishabh Review duration: 39011m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.62) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.62 · 264 lines diff across 3 files
    0.62
    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.334
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.062
    Real PR Conversation Timeline
    1 comments
    "Review active on #176"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    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: 62.5% (MEDIUM) · Higher = larger blast radius
    62.5%
    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: 24.7% · Safe to merge
    24.7%