Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove auth secret #831

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions pkg/drivers/powermax.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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)
Expand All @@ -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" {
Expand Down Expand Up @@ -140,7 +124,6 @@ func PrecheckPowerMax(ctx context.Context, cr *csmv1.ContainerStorageModule, ope
})
}

log.Debugw("preCheck", "secrets", cred)
return nil
}

Expand Down
1 change: 0 additions & 1 deletion samples/storage_csm_powermax_v2130.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ spec:
# Default value: 2
replicas: 2
# Default credential secret for Powermax, if not set it to ""
authSecret: powermax-creds
Sahiba-Gupta marked this conversation as resolved.
Show resolved Hide resolved
dnsPolicy: ClusterFirstWithHostNet
forceRemoveDriver: true
common:
Expand Down
Loading