Skip to content

Commit

Permalink
Revert "Automated cherry pick of kubernetes#97417: fix azure file sec…
Browse files Browse the repository at this point in the history
…ret not found issue"
  • Loading branch information
andyzhangx committed Mar 19, 2021
1 parent 2c03527 commit 7266a38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions pkg/volume/azure_file/azure_file.go
Expand Up @@ -55,8 +55,7 @@ var _ volume.PersistentVolumePlugin = &azureFilePlugin{}
var _ volume.ExpandableVolumePlugin = &azureFilePlugin{}

const (
azureFilePluginName = "kubernetes.io/azure-file"
defaultSecretNamespace = "default"
azureFilePluginName = "kubernetes.io/azure-file"
)

func getPath(uid types.UID, volName string, host volume.VolumeHost) string {
Expand Down Expand Up @@ -116,7 +115,7 @@ func (plugin *azureFilePlugin) newMounterInternal(spec *volume.Spec, pod *v1.Pod
if err != nil {
return nil, err
}
secretName, secretNamespace, err := getSecretNameAndNamespace(spec, defaultSecretNamespace)
secretName, secretNamespace, err := getSecretNameAndNamespace(spec, pod.Namespace)
if err != nil {
// Log-and-continue instead of returning an error for now
// due to unspecified backwards compatibility concerns (a subject to revise)
Expand Down Expand Up @@ -174,7 +173,7 @@ func (plugin *azureFilePlugin) ExpandVolumeDevice(
resourceGroup = spec.PersistentVolume.ObjectMeta.Annotations[resourceGroupAnnotation]
}

secretName, secretNamespace, err := getSecretNameAndNamespace(spec, defaultSecretNamespace)
secretName, secretNamespace, err := getSecretNameAndNamespace(spec, spec.PersistentVolume.Spec.ClaimRef.Namespace)
if err != nil {
return oldSize, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/volume/azure_file/azure_provision.go
Expand Up @@ -79,7 +79,7 @@ func (plugin *azureFilePlugin) newDeleterInternal(spec *volume.Spec, util azureU
return nil, fmt.Errorf("invalid PV spec")
}

secretName, secretNamespace, err := getSecretNameAndNamespace(spec, defaultSecretNamespace)
secretName, secretNamespace, err := getSecretNameAndNamespace(spec, spec.PersistentVolume.Spec.ClaimRef.Namespace)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 7266a38

Please sign in to comment.