11package v3
22
33import (
4- devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
5- dependencyutil "github.com/loft-sh/devspace/pkg/devspace/dependency/util"
6- "github.com/pkg/errors"
7- "github.com/sirupsen/logrus"
4+ "net/url"
85 "os"
96 "path/filepath"
107 "strconv"
118 "strings"
12- "net/url"
9+
10+ devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
11+ dependencyutil "github.com/loft-sh/devspace/pkg/devspace/dependency/util"
12+ "github.com/pkg/errors"
13+ "github.com/sirupsen/logrus"
1314
1415 "github.com/ghodss/yaml"
1516 "github.com/loft-sh/devspace/pkg/devspace/config/versions/latest"
@@ -30,6 +31,14 @@ func NewClient(log log.Logger) (types.Client, error) {
3031 return c , nil
3132}
3233
34+ func (c * client ) DownloadChart (ctx devspacecontext.Context , helmConfig * latest.HelmConfig ) (string , error ) {
35+ chartName , err := dependencyutil .DownloadDependency (ctx .Context (), ctx .WorkingDir (), helmConfig .Chart .Source , ctx .Log ())
36+ if err != nil {
37+ return "" , err
38+ }
39+ return filepath .Dir (chartName ), nil
40+ }
41+
3342// InstallChart installs the given chart via helm v3
3443func (c * client ) InstallChart (ctx devspacecontext.Context , releaseName string , releaseNamespace string , values map [string ]interface {}, helmConfig * latest.HelmConfig ) (* types.Release , error ) {
3544 valuesFile , err := c .genericHelm .WriteValues (values )
@@ -56,7 +65,7 @@ func (c *client) InstallChart(ctx devspacecontext.Context, releaseName string, r
5665 // Chart settings
5766 chartName := ""
5867 if helmConfig .Chart .Source != nil {
59- chartName , err = dependencyutil .DownloadDependency (ctx .Context (), ctx . WorkingDir (), helmConfig .Chart .Source , ctx . Log () )
68+ chartName , err = dependencyutil .GetDependencyPath (ctx .WorkingDir (), helmConfig .Chart .Source )
6069 if err != nil {
6170 return nil , err
6271 }
@@ -157,12 +166,11 @@ func (c *client) Template(ctx devspacecontext.Context, releaseName, releaseNames
157166 // Chart settings
158167 chartName := ""
159168 if helmConfig .Chart .Source != nil {
160- chartName , err = dependencyutil . DownloadDependency (ctx . Context (), ctx . WorkingDir (), helmConfig . Chart . Source , ctx . Log () )
169+ chartName , err = c . DownloadChart (ctx , helmConfig )
161170 if err != nil {
162171 return "" , err
163172 }
164173
165- chartName = filepath .Dir (chartName )
166174 args = append (args , chartName )
167175 } else {
168176 var chartRepo string
0 commit comments