Repository navigation
fix(install): use ca file for install (#7140) - #7164
Conversation
There was a problem hiding this comment.
Rewriting the repository file here is a little gross, but follows the pattern in other tests in chart_downloader_test.go where the server is stopped then restarted explicitly.
There was a problem hiding this comment.
r is not reassigned, so this line is redundant and can be removed.
|
Thanks for the PR to fix this. There is some duplication with #7071. Can you rebase and cleanup. You should be able to build off that. |
|
Huh, rebase from |
Fixes a few bugs related to tls config when installing charts: 1. When installing via relative path, tls config for the selected repository was not being set. 2. The `--ca-file` flag was not being passed when constructing the downloader. 3. Setting tls config was not checking for zero value in repo config, causing flag to get overwritten with empty string. There's still a few oddities here. I would expect that the flag passed in on the command line would override the repo config, but that's not currently the case. Also, we always set the cert, key and ca files as a trio, when they should be set individually depending on combination of flags / repo config. Signed-off-by: James McElwain <[email protected]>
| c.Options = append(c.Options, getter.WithBasicAuth(r.Config.Username, r.Config.Password)) | ||
| } | ||
|
|
||
| if r.Config.CertFile != "" || r.Config.KeyFile != "" || r.Config.CAFile != "" { |
There was a problem hiding this comment.
Was missing null check from previous pr.
There was a problem hiding this comment.
I didn't find that null check meaningful, as r could only be null if &{ ... } fails (out of memory or some such), and r.Config is the rc from the argument passed in to repo.NewChartRepository(), which can not be null at that point.
There was a problem hiding this comment.
Makes sense, sounds like this could be cleaned up by removing the check entirely. Just wanted to be consistent with guarding in the case it's necessary.
There was a problem hiding this comment.
Indeed, there were quite a few points that could be cleaned up throughout, but didn't want to introduce to many unrelated changes..
|
@mattfarina oops, didn't see the other PR had been merged. Just rebased and should be all clean now. Thanks! |
|
Closes #7140 |
|
Sorry to be annoying, but is there anyway this can get reviewed and merged sometime soon? This is currently blocking our orgs internal adoption of Helm due to pervasive use of self-signed certs. |
jdolitsky
left a comment
There was a problem hiding this comment.
This seems straightforward. Lgtm
Signed-off-by: James McElwain <[email protected]>
|
@jmcelwain Thanks for the fix |
Fixes a few bugs related to tls config when installing charts:
When installing via relative path, tls config for the selected
repository was not being set.
The
--ca-fileflag was not being passed when constructing thedownloader.
Setting tls config was not checking for zero value in repo
config, causing flag to get overwritten with empty string.
There's still a few oddities here. I would expect that the flag
passed in on the command line would override the repo config, but
that's not currently the case. Also, we always set the cert, key
and ca files as a trio, when they should be set individually
depending on combination of flags / repo config.
Signed-off-by: James McElwain [email protected]