Skip to content

Commit

Permalink
Merge pull request #100398 from andyzhangx/revert-97450-automated-che…
Browse files Browse the repository at this point in the history
…rry-pick-of-#97417-upstream-release-1.19

Revert "Automated cherry pick of #97417: fix azure file secret not found issue"
  • Loading branch information
k8s-ci-robot committed Mar 31, 2021
2 parents 9b98186 + 7266a38 commit 5f2edef
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 5f2edef

Please sign in to comment.