← Back to Pull requests

feat(crd): stamp recommended app.kubernetes.io labels on CRDs #518

Open
unknown opened this pull request with 333 lines diff across 4 files
View on GitHub
unknown unknown commented on Nov 27, 2026 15:59 UTC
Author

Description

Adds the recommended app.kubernetes.io labels to both CRDs (NodeReadinessRule and NodeReadinessEvaluation), so a managed provider or anyone else can tell NRC is already installed before putting in a second controller:

app.kubernetes.io/name: node-readiness-controller
app.kubernetes.io/part-of: node-readiness-controller
app.kubernetes.io/managed-by: node-readiness-controller

  • The labels come from +kubebuilder:metadata:labels markers on the root types, so make manifests generates them. The chart's crds/ copy of the NRR CRD is updated to match.

  • version and instance are left out because they change per release and per install, and don't fit static manifests.

  • installation.md gets a short "Detecting an Existing Installation" section with the kubectl get crd check and its limits: the labels say who packaged the CRD, not that a controller is running, and Helm keeps crds/ after uninstall.
  • This covers items 1 and 2 of #438. Item 3 (a Helm pre-install hook) is left out on purpose: #440 tried that and false-positived on reinstall, so it probably needs its own discussion.

    If #511 lands first, its chart copy of the NRE CRD will need the same 4-line label block re-synced (hack/verify-chart-drift.sh catches it). #502, #484 and #509 touch the same generated files, but only schema, so a rebase plus make manifests would sort it out.

    Related Issue

    Refs #438

    Type of Change

    /kind feature

    Testing

    On the current head, which already sits on main 0eefab6:

  • make manifests leaves no diff, and hack/verify-chart-drift.sh passes (the chart CRD is byte-identical to the generated one).

  • make test and make lint pass, and so does hack/verify-all.sh.

  • Applied both CRDs to an envtest apiserver (1.36.2); kubectl get crd nodereadinessrules.readiness.node.x-k8s.io -o jsonpath='{.metadata.labels.app\.kubernetes\.io/managed-by}' returns node-readiness-controller.

  • helm lint was clean and helm unittest passed 53/53 on this same code.
  • Checklist


  • make test passes

  • make lint passes
  • Does this PR introduce a user-facing change?

    ``release-note
    The NodeReadinessRule and NodeReadinessEvaluation CRDs now carry the app.kubernetes.io/name, part-of and managed-by labels, which can be used to detect an existing installation.
    ``

    Generative AI Usage Disclosure


  • No AI tools were used

  • AI tools were used (complete below)
  • How they were used:
    Claude helped with the marker changes, the docs section and running the checks. The generated CRDs and docs were reviewed and the checks above were re-run on the final head before marking this ready.

    Diff: 333 lines (+249 / -84) across 4 files Reviewer: ajaysundark Review duration: 8079m
    All Vouch review confidence checks passed
    Residual risk 0.35 = Change Risk (0.65) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.65 · 333 lines diff across 4 files
    0.65
    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%
    46%
    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.348
    Shallow Review Depth shallow_review_depth
    0.344
    Sensitive Paths sensitive_paths
    0.065
    Real PR Conversation Timeline
    1 comments
    "Review active on #518"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 65.3% (HIGH) · Higher = larger blast radius
    65.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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 34.8% · Safe to merge
    34.8%