← Back to Pull requests

fix(oidc): treat empty desired thumbprints as no opinion #212

Open
unknown opened this pull request with 308 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 10, 2026 14:28 UTC
Author

Issue #, if available: related to aws-controllers-k8s/community#2450 (same symptom, fixed for the create path) and aws-controllers-k8s/community#3123 (same class of bug on EKS adopt-or-create)

Description of changes:

An OpenIDConnectProvider adopted with services.k8s.aws/adoption-policy: adopt-or-create (and adoption-fields: {"arn": ...}) never syncs when its spec leaves thumbprints empty:

1. The adoption reads the provider by ARN and marks the CR adopted.
2. The delta compares the empty desired Thumbprints with the list IAM computed at creation, and reports a difference.
3. customUpdateOpenIDConnectProvider calls UpdateOpenIDConnectProviderThumbprint with an empty ThumbprintList, which the SDK rejects client side:

   operation error IAM: UpdateOpenIDConnectProviderThumbprint, 1 validation error(s) found.
   - missing required field, UpdateOpenIDConnectProviderThumbprintInput.ThumbprintList.
   

4. The CR stays ACK.Recoverable / Ready=False and retries forever.

Late initialization (#159, the fix for community#2450) fills Spec.Thumbprints after a create, but on the adopt path the delta runs first, so it never gets the chance.

Thumbprints are optional on CreateOpenIDConnectProvider, so an empty desired list carries no opinion. This marks Thumbprints compare.is_ignored (as URL already is) and compares them in customPreCompare only when the desired spec lists any. Explicit thumbprints are still enforced, and late initialization still records the computed ones after a create.

Reproduced against v1.11.2: a provider created out of band (tagged, with a thumbprint), then a CR with adopt-or-create + adoption-fields, no thumbprints. The CR is adopted and then loops on the error above.

Testing:

  • New TestNewResourceDeltaThumbprints (empty desired, equal, changed, added, and desired-but-not-in-AWS); the empty-desired case fails on main and passes with this change.

  • go test ./pkg/resource/open_id_connect_provider/ passes.
  • Note: delta.go is edited by hand to match what is_ignored generates (the Thumbprints block removed, as for URL); apis/v1alpha1/ack-generate-metadata.yaml is not regenerated, as I could not run the code generator here. Happy to regenerate it if you prefer that in this PR.

    By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

    🤖 Generated with Claude Code

    Diff: 308 lines (+231 / -77) across 3 files Reviewer: blacksoxx Review duration: 17598m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 308 lines diff across 3 files
    0.40
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.343
    Real PR Conversation Timeline
    1 comments
    "Review active on #212"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 40.2% (MEDIUM) · Higher = larger blast radius
    40.2%
    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: 21.4% · Safe to merge
    21.4%