-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Update to Helm v3.7.1, allow to pass credentials and new OCI support #7249
Conversation
I need help on this one. Since Helm v3.6.1, Helm doesn't pass credentials (username and password) to chart URLs if the domain doesn't match the index URL. I tried to add the
(ref) @jannfis Could you help me? NB: Having to wait approval to get the CI is annoying. I've created sathieu#1 to workaround this. |
Codecov Report
@@ Coverage Diff @@
## master #7249 +/- ##
==========================================
+ Coverage 41.39% 41.40% +0.01%
==========================================
Files 161 161
Lines 21642 21656 +14
==========================================
+ Hits 8958 8967 +9
- Misses 11421 11424 +3
- Partials 1263 1265 +2
Continue to review full report at Codecov.
|
@sathieu Thanks for trying to tackle this. IMHO, this should not be a setting on repository (or repocreds) level, but for each application, in the
|
Also, if you modify the CLI (for the |
f1453b6
to
551aa7d
Compare
Repos have either all artifacts under the same domain, or all artifacts under a different domain, so this looks more like a repo setting. This is also very tightly linked with the username and password, already stored in repo and repocreds.
Done. Still, I couldn't get the CI to pass, any idea? EDIT: I've fixed one more item:
|
e8b9352
to
a1c5244
Compare
966f03f
to
0ae152e
Compare
@jannfis Please review again, CI is now passing. This was an |
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.
Thanks for working on it @samath117 !
Added a couple of questions. Just want to confirm that there is a way for end users to downgrade to helm v3.6 and proposing to document the breaking change.
Did not actually request any changes, so LGTM
(waiting for feedback from @jannfis as well)
cmd.Dir = tempDest | ||
_, err = executil.Run(cmd) | ||
// 'helm pull' ensures that chart is downloaded into temp directory | ||
_, err = helmCmd.PullOCI(c.repoURL, chart, version, tempDest) |
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.
Just double-checked that helm package
is available in helm 3.6, so users should be able to downgrade to v3.6 if they are not ready for v3.7. Is your understanding the same?
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.
Unfortunately not. The way Helm charts are stored in the repository is completely different.
To extract an OCI chart
# In Helm v3.6.x:
helm chart pull $repo/$chart:$version # goes in helm local cache
helm chart export $repo/$chart:$version --destination $tempdest
tar -zcvf /argo/cache/$chart-$version.tgz $tempdest/$chart
# -> chart is available in /argo/cache/$chart-$version.tgz
# In Helm v3.7.x:
helm pull oci://$repo/$chart --version $version --destination $tempdest
# -> chart is available in $tempdest/$chart-$version.tgz
If e need to support both versions, I'll need to improve the code.
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.
Also note that an OCI chart for v3.6.x is not usable in helm v3.7.x and vice-versa.
util/settings/settings.go
Outdated
PasswordSecret *apiv1.SecretKeySelector `json:"passwordSecret,omitempty"` | ||
CertSecret *apiv1.SecretKeySelector `json:"certSecret,omitempty"` | ||
KeySecret *apiv1.SecretKeySelector `json:"keySecret,omitempty"` | ||
HelmPassCredentials bool `json:"helmPassCredentials,omitempty"` |
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.
Debating about introducing a breaking change: potentially we can assume that pass-credentials
is true by default to simplify the migration. This is probably a bad idea due to CVE-2021-32690. So it is better to break backward compatibility.
In this case can you please document the change in https://github.com/argoproj/argo-cd/tree/master/docs/operator-manual/upgrading/2.1-2.2
@jannfis are you thinking the same?
@jannfis , I've noticed your comment about adding app-level setting: #7249 (comment) I'm curious why do you think this is necessary? It feels like per repo setting is a better option since it is per repo setting in the helm itself. E.g. |
This really makes sense. Thanks. I'll update this PR to move this setting in the application (just wait some days, this takes time...) Also, I've updated Helm to v3.71, which adds support for pre-3.7 oci charts (helm/helm@52fbd4e). This addresses #7249 (comment). |
Thanks a lot @sathieu ! Looking forward for this PR |
1e20dee
to
7dafe33
Compare
Thank you for the awesome contribution @sathieu! |
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.
LGTM. Thanks for this awesome contribution and for going the extra mile with us @sathieu, and sorry for the lagging communication from my side.
Your efforts and patience are much appreciated!
Reminder /cc @alexmt We will need some UI changes for this change in a a separate PR. |
Signed-off-by: Mathieu Parent <[email protected]>
Signed-off-by: Mathieu Parent <[email protected]>
Signed-off-by: Mathieu Parent <[email protected]>
Signed-off-by: Mathieu Parent <[email protected]>
7dafe33
to
c63b0c2
Compare
@jannfis The tests are now passing (the fix was just one line in
The fix:
diff --git a/test/e2e/helm_test.go b/test/e2e/helm_test.go
index b6148e8ab..e44ef9d1a 100644
--- a/test/e2e/helm_test.go
+++ b/test/e2e/helm_test.go
@@ -358,6 +358,7 @@ func TestHelmWithMultipleDependencies(t *testing.T) {
// these are slow tests
Timeout(30).
HelmHTTPSCredentialsUserPassAdded().
+ HelmPassCredentials().
When().
Create().
Sync(). |
- The previous helm vesrion had issue with pulling OCI charts (see argoproj/argo-cd#7249) - Adding integration test for helm oci use-case
Fixes #7364.
Checklist: