Fix install use URL base authentication

pull/9893/head
王炜 4 years ago
parent eb99434597
commit 6eb74c9c71

@ -688,6 +688,10 @@ func (c *ChartPathOptions) LocateChart(name string, settings *cli.EnvSettings) (
// Host on URL (returned from url.Parse) contains the port if present. // Host on URL (returned from url.Parse) contains the port if present.
// This check ensures credentials are not passed between different // This check ensures credentials are not passed between different
// services on different ports. // services on different ports.
if password, ok := u1.User.Password(); ok {
c.Username = u1.User.Username()
c.Password = password
}
if c.PassCredentialsAll || (u1.Scheme == u2.Scheme && u1.Host == u2.Host) { if c.PassCredentialsAll || (u1.Scheme == u2.Scheme && u1.Host == u2.Host) {
dl.Options = append(dl.Options, getter.WithBasicAuth(c.Username, c.Password)) dl.Options = append(dl.Options, getter.WithBasicAuth(c.Username, c.Password))
} else { } else {

Loading…
Cancel
Save