empty cred check failed to fall back#2020
Conversation
Signed-off-by: grokspawn <jordan@nimblewidget.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
Updates the containers/image-based registry pull logic to better handle REGISTRY_AUTH_FILE cases where the auth file is present but contains no usable credentials for the target registry, allowing credential lookup to fall back instead of forcing an “empty creds” auth file.
Changes:
- In
Pull, avoid mutating the sharedSystemContextby copying it and only overridingAuthFilePathwhen appropriate. - In
getAuthFile, treat “parsed but empty credentials” as “no creds found” so the caller can fall back. - Add unit tests covering matching creds, non-matching creds, empty auth file, and fallback behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/image/containersimageregistry/registry.go | Copies SystemContext for per-call auth selection and adds an “empty creds” check when probing auth files. |
| pkg/image/containersimageregistry/registry_test.go | Adds tests for getAuthFile behavior across matching/non-matching/empty auth scenarios and fallback paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2020 +/- ##
==========================================
+ Coverage 58.75% 58.81% +0.05%
==========================================
Files 141 141
Lines 13426 13430 +4
==========================================
+ Hits 7889 7899 +10
+ Misses 4325 4322 -3
+ Partials 1212 1209 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: grokspawn <jordan@nimblewidget.com>
Description of the change:
getAuthFileevaluates only if the credentials file can be parsed, which leads to concurrence between 'no creds found' and 'creds found' paths, so this PR introduces a new "empty creds" check which allows fallback to system default creds if empty. Adds unit tests to prove the change.Motivation for the change:
Resolves #1826
Reviewer Checklist
/docs