@@ -3,10 +3,12 @@ package v3
33import (
44 devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
55 dependencyutil "github.com/loft-sh/devspace/pkg/devspace/dependency/util"
6+ "github.com/pkg/errors"
67 "github.com/sirupsen/logrus"
78 "os"
89 "path/filepath"
910 "strconv"
11+ "strings"
1012
1113 "github.com/ghodss/yaml"
1214 "github.com/loft-sh/devspace/pkg/devspace/config/versions/latest"
@@ -71,11 +73,22 @@ func (c *client) InstallChart(ctx devspacecontext.Context, releaseName string, r
7173 if helmConfig .Chart .Version != "" {
7274 args = append (args , "--version" , helmConfig .Chart .Version )
7375 }
74- if helmConfig .Chart .Username != "" {
75- args = append (args , "--username" , helmConfig .Chart .Username )
76- }
77- if helmConfig .Chart .Password != "" {
78- args = append (args , "--password" , helmConfig .Chart .Password )
76+
77+ // log into OCI registry if specified
78+ if strings .HasPrefix (chartName , "oci://" ) {
79+ 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+ if err != nil {
82+ return nil , errors .Wrap (err , "login oci registry" )
83+ }
84+ }
85+ } else {
86+ if helmConfig .Chart .Username != "" {
87+ args = append (args , "--username" , helmConfig .Chart .Username )
88+ }
89+ if helmConfig .Chart .Password != "" {
90+ args = append (args , "--password" , helmConfig .Chart .Password )
91+ }
7992 }
8093 }
8194
0 commit comments