@@ -363,6 +363,7 @@ func uninstallHelmCharts(ctx context.Context, c client.Client, clusterSummary *c
363363 if err != nil && ! errors .Is (err , driver .ErrReleaseNotFound ) {
364364 return nil , err
365365 }
366+
366367 if currentRelease != nil && currentRelease .Status != string (release .StatusUninstalled ) {
367368 err = doUninstallRelease (ctx , clusterSummary , currentChart , kubeconfig , registryOptions , logger )
368369 if err != nil {
@@ -1253,7 +1254,6 @@ func getRegistryClient(namespace string, registryOptions *registryClientOptions,
12531254 }
12541255 return registry .NewClient (options ... )
12551256 }
1256-
12571257 return registry .NewRegistryClientWithTLS (os .Stderr , "" , "" , registryOptions .caPath ,
12581258 registryOptions .skipTLSVerify , registryOptions .credentialsPath , settings .Debug )
12591259}
@@ -2511,6 +2511,10 @@ func createFileWithCredentials(ctx context.Context, c client.Client, clusterName
25112511 return "" , err
25122512 }
25132513
2514+ if secret .Type != corev1 .SecretTypeDockerConfigJson {
2515+ return "" , nil
2516+ }
2517+
25142518 if secret .Data == nil {
25152519 return "" , errors .New (fmt .Sprintf ("secret %s/%s referenced in HelmChart section contains no data" ,
25162520 namespace , credSecretRef .Name ))
@@ -2636,7 +2640,7 @@ func doLogin(ctx context.Context, c client.Client, registryOptions *registryClie
26362640 return err
26372641 }
26382642
2639- username , password , host , err := getUsernameAndPasswordFromSecret (registryURL , secret )
2643+ username , password , hostname , err := getUsernameAndPasswordFromSecret (registryURL , secret )
26402644 if err != nil {
26412645 return err
26422646 }
@@ -2646,8 +2650,15 @@ func doLogin(ctx context.Context, c client.Client, registryOptions *registryClie
26462650 return err
26472651 }
26482652
2649- options := []registry.LoginOption {registry .LoginOptBasicAuth (username , password )}
2650- return registryClient .Login (host , options ... )
2653+ cfg := & action.Configuration {
2654+ RegistryClient : registryClient ,
2655+ }
2656+
2657+ return action .NewRegistryLogin (cfg ).Run (os .Stderr , hostname , username , password ,
2658+ action .WithCertFile ("" ),
2659+ action .WithKeyFile ("" ),
2660+ action .WithCAFile (registryOptions .caPath ),
2661+ action .WithInsecure (registryOptions .skipTLSVerify ))
26512662}
26522663
26532664// usernameAndPasswordFromSecret derives authentication data from a Secret to login to an OCI registry. This Secret
0 commit comments