From bad6c2de18bd29749ca1340abe79304000bb2fbd Mon Sep 17 00:00:00 2001 From: Grant Griffiths Date: Wed, 15 May 2019 00:04:30 -0700 Subject: [PATCH] Remove explicit storage class parameter validation Signed-off-by: Grant Griffiths --- pkg/controller/controller.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index e48d48da9..71bb90354 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -562,19 +562,6 @@ func (p *csiProvisioner) Provision(options controller.VolumeOptions) (*v1.Persis return pv, nil } -func validateStorageClassParameters(params map[string]string) error { - for k, v := range params { - switch { - case strings.Contains(k, prefixedProvisionerSecretNameKey) && strings.Contains(v, "pvc.annotations"): - return fmt.Errorf("Secret name stored in storage class parameters is not supported") - case strings.Contains(k, prefixedProvisionerSecretNamespaceKey) && strings.Contains(v, "pvc.annotations"): - return fmt.Errorf("Secret namespace stored in storage class parameters is not supported") - } - } - - return nil -} - func (p *csiProvisioner) supportsTopology() bool { return p.pluginCapabilities[csi.PluginCapability_Service_VOLUME_ACCESSIBILITY_CONSTRAINTS] && utilfeature.DefaultFeatureGate.Enabled(features.Topology) @@ -791,11 +778,6 @@ func verifyAndGetSecretNameAndNamespaceTemplate(secret secretParamsMap, storageC // - the resolved name is not a valid secret name // - the resolved namespace is not a valid namespace name func getSecretReference(secretParams secretParamsMap, storageClassParams map[string]string, pvName string, pvc *v1.PersistentVolumeClaim) (*v1.SecretReference, error) { - // Ensure that no unsupported SC parameters are passed in. - if err := validateStorageClassParameters(storageClassParams); err != nil { - return nil, err - } - nameTemplate, namespaceTemplate, err := verifyAndGetSecretNameAndNamespaceTemplate(secretParams, storageClassParams) if err != nil { return nil, fmt.Errorf("failed to get name and namespace template from params: %v", err)