Skip to content

Commit 0a50367

Browse files
authored
Merge pull request #2242 from CiiDyR/fix/helm-registry-login-missing-target-registry
fix: supply helm registry for oci login
2 parents 685e7bc + 06de595 commit 0a50367

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pkg/devspace/helm/v3/client.go

Lines changed: 7 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,12 @@ 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+
_, err = c.genericHelm.Exec(ctx, []string{"registry", "login", chartNameUrl.Hostname(), "--username", helmConfig.Chart.Username, "--password", helmConfig.Chart.Password})
8187
if err != nil {
8288
return nil, errors.Wrap(err, "login oci registry")
8389
}

0 commit comments

Comments
 (0)