Commit 75cce698
75cce698b1a3Merged
zhiliaev <[email protected]> ยท 4 years ago ยท 1 file ยท ~1 modified
Description
fix: #410 skip if username is empty
Details
- Commit
- 75cce698b1a3
- Parent
- 574b34debad0
pkg/registry/install.gomodifiedView file
@@ -7,22 +7,17 @@
77
"helm.sh/helm/v3/pkg/registry"88
)99
10-
func (reg *config) Install() error {11-
var options []registry.LoginOption12-
10+
func (c *config) Install() error {1311
// Allow public OCI registry #410.14-
if reg.Username != "" && reg.Password != "" {15-
options = append(options, registry.LoginOptBasicAuth(reg.Username, reg.Password))16-
}17-
18-
// I Know.19-
if reg.Insecure {20-
options = append(options, registry.LoginOptInsecure(reg.Insecure))12+
if c.Username == "" {13+
c.Logger().Debugln("Public OCI chart. Skipping helm login.")14+
return nil2115
}2216
2317
err := helper.HelmRegistryClient.Login(24-
reg.Host(),25-
options...,18+
c.Host(),19+
registry.LoginOptBasicAuth(c.Username, c.Password),20+
registry.LoginOptInsecure(c.Insecure),2621
)2722
2823
if err != nil {