-
Couldn't load subscription status.
- Fork 121
helm: login to private registries #3661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3661 +/- ##
==========================================
- Coverage 42.36% 42.26% -0.11%
==========================================
Files 87 88 +1
Lines 12669 12709 +40
==========================================
+ Hits 5367 5371 +4
- Misses 6907 6944 +37
+ Partials 395 394 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For discussion:
- is this change affecting Release or Chart or both?
- does it have the same side-effect that helm install would normally?
- tool.go seems to be drifting away from the upstream, e.g. refactored tls. how close can we stick to upstream?
- is this affecting oci registries or also helm registries?
| // Login can fail for harmless reasons like already being | ||
| // logged in. Optimistically ignore those errors. | ||
| if err := c.Login(u.Host, registry.LoginOptBasicAuth(i.Username, i.Password)); err != nil { | ||
| logger.V(6).Infof("[helm] %s", fmt.Sprintf("login error: %s", err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use a lower verbosity for this important message.
Also, consider writing a log message when login was successful, maybe mentioning that the user's environment was modified.
This is a continuation of #3314.
The bulk of the new work went into crafting a failing test case. In short it:
Testing revealed that setting
registry.ClientOptBasicAuth(username, password)on the client is insufficient. This sorta makes sense to me -- Helm doesn't want to blindly pass that username and password to any registry the client might interact with.The solution I came up with isn't super satisfying but essentially performs the
helm loginwe're currently asking users to perform manually. This can fail for a number of reasons, for example if we're already logged in, so we optimistically ignore errors here.Chart v4 and Release v3 are both confirmed to be working. The Release provider's client setup is awkwardly separate from our Chart handling (Chart being more correct), but consolidating those two flows is a separate work item.
Fixes #2911.
Fixes #1914.