@ -117,13 +117,20 @@ type ChartPathOptions struct {
Username string // --username
Username string // --username
Verify bool // --verify
Verify bool // --verify
Version string // --version
Version string // --version
// registryClient provides a registry client but is not added with
// options from a flag
registryClient * registry . Client
}
}
// NewInstall creates a new Install object with the given configuration.
// NewInstall creates a new Install object with the given configuration.
func NewInstall ( cfg * Configuration ) * Install {
func NewInstall ( cfg * Configuration ) * Install {
return & Install {
in := & Install {
cfg : cfg ,
cfg : cfg ,
}
}
in . ChartPathOptions . registryClient = cfg . RegistryClient
return in
}
}
func ( i * Install ) installCRDs ( crds [ ] chart . CRD ) error {
func ( i * Install ) installCRDs ( crds [ ] chart . CRD ) error {
@ -662,6 +669,12 @@ OUTER:
//
//
// If 'verify' was set on ChartPathOptions, this will attempt to also verify the chart.
// If 'verify' was set on ChartPathOptions, this will attempt to also verify the chart.
func ( c * ChartPathOptions ) LocateChart ( name string , settings * cli . EnvSettings ) ( string , error ) {
func ( c * ChartPathOptions ) LocateChart ( name string , settings * cli . EnvSettings ) ( string , error ) {
// If there is no registry client and the name is in an OCI registry return
// an error and a lookup will not occur.
if registry . IsOCI ( name ) && c . registryClient == nil {
return "" , fmt . Errorf ( "unable to lookup chart %q, missing registry client" , name )
}
name = strings . TrimSpace ( name )
name = strings . TrimSpace ( name )
version := strings . TrimSpace ( c . Version )
version := strings . TrimSpace ( c . Version )
@ -692,12 +705,7 @@ func (c *ChartPathOptions) LocateChart(name string, settings *cli.EnvSettings) (
} ,
} ,
RepositoryConfig : settings . RepositoryConfig ,
RepositoryConfig : settings . RepositoryConfig ,
RepositoryCache : settings . RepositoryCache ,
RepositoryCache : settings . RepositoryCache ,
}
RegistryClient : c . registryClient ,
if registry . IsOCI ( name ) {
if version != "" {
dl . Options = append ( dl . Options , getter . WithTagName ( version ) )
}
}
}
if c . Verify {
if c . Verify {