Skip to content

fix: return registry secret lookup errors from resolveRegistrySecretName#584

Open
ashnaaseth2325-oss wants to merge 1 commit into
openkruise:masterfrom
ashnaaseth2325-oss:fix/commit-registry-secret-error-handling
Open

fix: return registry secret lookup errors from resolveRegistrySecretName#584
ashnaaseth2325-oss wants to merge 1 commit into
openkruise:masterfrom
ashnaaseth2325-oss:fix/commit-registry-secret-error-handling

Conversation

@ashnaaseth2325-oss

Copy link
Copy Markdown

SUMMARY

This PR updates registry secret resolution to distinguish transient API errors from missing secrets during Commit job creation. Instead of silently falling back to anonymous pushes on any lookup failure, transient errors are now returned so the controller can retry the reconciliation.

The changes primarily affect pkg/controller/commit/core/common_control.go and its associated unit tests.

FIX

// Before
g.DockerConfigSecretName = r.resolveRegistrySecretName(ctx, commit)

// After
secretName, err := r.resolveRegistrySecretName(ctx, commit)
if err != nil {
    return 0, err
}
g.DockerConfigSecretName = secretName

resolveRegistrySecretName previously swallowed all Get errors at V(4),
causing a silent fall-through to anonymous push on any API server blip.
Distinguish IsNotFound (skip to next secret) from transient errors
(return error so the controller retries with exponential back-off).

Signed-off-by: ashnaaseth2325-oss <ashnaaseth2325@gmail.com>
@kruise-bot kruise-bot requested review from AiRanthem and zmberg June 27, 2026 14:51
@kruise-bot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign airanthem for approval by writing /assign @airanthem in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.83%. Comparing base (6205b42) to head (afc7553).

Files with missing lines Patch % Lines
pkg/controller/commit/core/common_control.go 60.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #584      +/-   ##
==========================================
- Coverage   79.84%   79.83%   -0.01%     
==========================================
  Files         202      202              
  Lines       14795    14800       +5     
==========================================
+ Hits        11813    11816       +3     
- Misses       2552     2553       +1     
- Partials      430      431       +1     
Flag Coverage Δ
unittests 79.83% <60.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants