diff --git a/pkg/drivers/powermax.go b/pkg/drivers/powermax.go index 72422629..9988fddc 100644 --- a/pkg/drivers/powermax.go +++ b/pkg/drivers/powermax.go @@ -24,8 +24,6 @@ import ( "github.com/dell/csm-operator/pkg/logger" "github.com/dell/csm-operator/pkg/utils" corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -59,14 +57,10 @@ const ( ) // PrecheckPowerMax do input validation -func PrecheckPowerMax(ctx context.Context, cr *csmv1.ContainerStorageModule, operatorConfig utils.OperatorConfig, ct client.Client) error { +func PrecheckPowerMax(ctx context.Context, cr *csmv1.ContainerStorageModule, operatorConfig utils.OperatorConfig, _ client.Client) error { log := logger.GetLogger(ctx) // Check for default secret only // Array specific will be authenticated in csireverseproxy - cred := cr.Name + "-creds" - if cr.Spec.Driver.AuthSecret != "" { - cred = cr.Spec.Driver.AuthSecret - } // Check if driver version is supported by doing a stat on a config file configFilePath := fmt.Sprintf("%s/driverconfig/powermax/%s/upgrade-path.yaml", operatorConfig.ConfigDirectory, cr.Spec.Driver.ConfigVersion) @@ -75,16 +69,6 @@ func PrecheckPowerMax(ctx context.Context, cr *csmv1.ContainerStorageModule, ope return fmt.Errorf("%s %s not supported", csmv1.PowerMax, cr.Spec.Driver.ConfigVersion) } - if cred != "" { - found := &corev1.Secret{} - err := ct.Get(ctx, types.NamespacedName{Name: cred, Namespace: cr.GetNamespace()}, found) - if err != nil { - log.Error(err, "Failed query for secret ", cred) - if errors.IsNotFound(err) { - return fmt.Errorf("failed to find secret %s", cred) - } - } - } kubeletConfigDirFound := false for _, env := range cr.Spec.Driver.Common.Envs { if env.Name == "KUBELET_CONFIG_DIR" { @@ -140,7 +124,6 @@ func PrecheckPowerMax(ctx context.Context, cr *csmv1.ContainerStorageModule, ope }) } - log.Debugw("preCheck", "secrets", cred) return nil } diff --git a/pkg/drivers/powermax_test.go b/pkg/drivers/powermax_test.go index 82b81c42..4a6dae89 100644 --- a/pkg/drivers/powermax_test.go +++ b/pkg/drivers/powermax_test.go @@ -47,7 +47,6 @@ var ( }{ {"happy path", powerMaxCSM, powerMaxClient, powerMaxSecret, ""}, {"no proxy set defaults", powerMaxCSMNoProxy, powerMaxClient, powerMaxSecret, ""}, - {"missing secret", powerMaxCSM, powerMaxClient, pMaxfakeSecret, "failed to find secret"}, {"bad version", powerMaxCSMBadVersion, powerMaxClient, powerMaxSecret, "not supported"}, {"bad latest version", powermaxDefaultKubeletPath, powerMaxClient, powerMaxSecret, ""}, } diff --git a/samples/storage_csm_powermax_v2110.yaml b/samples/storage_csm_powermax_v2110.yaml index e9a55a2f..fb7a7b5c 100644 --- a/samples/storage_csm_powermax_v2110.yaml +++ b/samples/storage_csm_powermax_v2110.yaml @@ -40,7 +40,6 @@ spec: # Default value: 2 replicas: 2 # Default credential secret for Powermax, if not set it to "" - authSecret: powermax-creds dnsPolicy: ClusterFirstWithHostNet forceRemoveDriver: true common: diff --git a/samples/storage_csm_powermax_v2120.yaml b/samples/storage_csm_powermax_v2120.yaml index e4812748..ca00bc5e 100644 --- a/samples/storage_csm_powermax_v2120.yaml +++ b/samples/storage_csm_powermax_v2120.yaml @@ -40,7 +40,6 @@ spec: # Default value: 2 replicas: 2 # Default credential secret for Powermax, if not set it to "" - authSecret: powermax-creds dnsPolicy: ClusterFirstWithHostNet forceRemoveDriver: true common: diff --git a/samples/storage_csm_powermax_v2130.yaml b/samples/storage_csm_powermax_v2130.yaml index df05e63c..93bc4a21 100644 --- a/samples/storage_csm_powermax_v2130.yaml +++ b/samples/storage_csm_powermax_v2130.yaml @@ -40,7 +40,6 @@ spec: # Default value: 2 replicas: 2 # Default credential secret for Powermax, if not set it to "" - authSecret: powermax-creds dnsPolicy: ClusterFirstWithHostNet forceRemoveDriver: true common: