New ๐ŸŒŠ wave for @helm

Commit 574b34de

574b34debad0Merged

zhiliaev <[email protected]> ยท 4 years ago ยท 1 file ยท ~1 modified

Description

fix: #410

Details

Commit
574b34debad0
Parent
2940cd0e4dc9

pkg/registry/install.gomodifiedView file

@@ -8,11 +8,23 @@
88 )
99
1010 func (reg *config) Install() error {
11+ var options []registry.LoginOption
12+
13+ // 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))
21+ }
22+
1123 err := helper.HelmRegistryClient.Login(
1224 reg.Host(),
13- registry.LoginOptBasicAuth(reg.Username, reg.Password),
14- registry.LoginOptInsecure(reg.Insecure),
25+ options...,
1526 )
27+
1628 if err != nil {
1729 return fmt.Errorf("failed to login in helm registry: %w", err)
1830 }