Skip to content

Commit b6d33c7

Browse files
committed
fix: supply helm registry for oci login
1 parent 685e7bc commit b6d33c7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

pkg/devspace/helm/v3/client.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"path/filepath"
1010
"strconv"
1111
"strings"
12+
"net/url"
1213

1314
"github.com/ghodss/yaml"
1415
"github.com/loft-sh/devspace/pkg/devspace/config/versions/latest"
@@ -77,7 +78,14 @@ func (c *client) InstallChart(ctx devspacecontext.Context, releaseName string, r
7778
// log into OCI registry if specified
7879
if strings.HasPrefix(chartName, "oci://") {
7980
if helmConfig.Chart.Username != "" && helmConfig.Chart.Password != "" {
80-
_, err := c.genericHelm.Exec(ctx, []string{"registry", "login", "--username", helmConfig.Chart.Username, "--password", helmConfig.Chart.Password})
81+
chartNameUrl, err := url.Parse(chartName)
82+
if err != nil {
83+
return nil, errors.Wrap(err, "chartName malformed for oci registry")
84+
}
85+
86+
ctx.Log().Infof("registry hostname: %v", chartNameUrl.Hostname())
87+
88+
_, err = c.genericHelm.Exec(ctx, []string{"registry", "login", chartNameUrl.Hostname(), "--username", helmConfig.Chart.Username, "--password", helmConfig.Chart.Password})
8189
if err != nil {
8290
return nil, errors.Wrap(err, "login oci registry")
8391
}

0 commit comments

Comments
 (0)