mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #97417 from andyzhangx/azurefile-secret
fix Azure file share not deleted issue when the namespace is deleted
This commit is contained in:
commit
2490a797a2
@ -55,7 +55,8 @@ var _ volume.PersistentVolumePlugin = &azureFilePlugin{}
|
||||
var _ volume.ExpandableVolumePlugin = &azureFilePlugin{}
|
||||
|
||||
const (
|
||||
azureFilePluginName = "kubernetes.io/azure-file"
|
||||
azureFilePluginName = "kubernetes.io/azure-file"
|
||||
defaultSecretNamespace = "default"
|
||||
)
|
||||
|
||||
func getPath(uid types.UID, volName string, host volume.VolumeHost) string {
|
||||
@ -115,7 +116,7 @@ func (plugin *azureFilePlugin) newMounterInternal(spec *volume.Spec, pod *v1.Pod
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
secretName, secretNamespace, err := getSecretNameAndNamespace(spec, pod.Namespace)
|
||||
secretName, secretNamespace, err := getSecretNameAndNamespace(spec, defaultSecretNamespace)
|
||||
if err != nil {
|
||||
// Log-and-continue instead of returning an error for now
|
||||
// due to unspecified backwards compatibility concerns (a subject to revise)
|
||||
@ -173,7 +174,7 @@ func (plugin *azureFilePlugin) ExpandVolumeDevice(
|
||||
resourceGroup = spec.PersistentVolume.ObjectMeta.Annotations[resourceGroupAnnotation]
|
||||
}
|
||||
|
||||
secretName, secretNamespace, err := getSecretNameAndNamespace(spec, spec.PersistentVolume.Spec.ClaimRef.Namespace)
|
||||
secretName, secretNamespace, err := getSecretNameAndNamespace(spec, defaultSecretNamespace)
|
||||
if err != nil {
|
||||
return oldSize, err
|
||||
}
|
||||
|
@ -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, spec.PersistentVolume.Spec.ClaimRef.Namespace)
|
||||
secretName, secretNamespace, err := getSecretNameAndNamespace(spec, defaultSecretNamespace)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user