Merge pull request #95892 from JornShen/fix_plugin_name_for_fsgroupmetrics
Fix plugin name in fsgroupapplymetrics of csi and flexvolume
This commit is contained in:
		| @@ -428,7 +428,7 @@ func (b *awsElasticBlockStoreMounter) SetUpAt(dir string, mounterArgs volume.Mou | ||||
| 	} | ||||
|  | ||||
| 	if !b.readOnly { | ||||
| 		volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin.GetPluginName())) | ||||
| 		volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) | ||||
| 	} | ||||
|  | ||||
| 	klog.V(4).Infof("Successfully mounted %s", dir) | ||||
|   | ||||
| @@ -164,7 +164,7 @@ func (m *azureDiskMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) e | ||||
| 	} | ||||
|  | ||||
| 	if volumeSource.ReadOnly == nil || !*volumeSource.ReadOnly { | ||||
| 		volume.SetVolumeOwnership(m, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(m.plugin.GetPluginName())) | ||||
| 		volume.SetVolumeOwnership(m, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(m.plugin, m.spec)) | ||||
| 	} | ||||
|  | ||||
| 	klog.V(2).Infof("azureDisk - successfully mounted disk %s on %s", diskName, dir) | ||||
|   | ||||
| @@ -448,7 +448,7 @@ func (b *cinderVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs | ||||
| 	} | ||||
|  | ||||
| 	if !b.readOnly { | ||||
| 		volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin.GetPluginName())) | ||||
| 		volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) | ||||
| 	} | ||||
| 	klog.V(3).Infof("Cinder volume %s mounted to %s", b.pdName, dir) | ||||
|  | ||||
|   | ||||
| @@ -256,7 +256,7 @@ func (b *configMapVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterA | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	err = volume.SetVolumeOwnership(b, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin.GetPluginName())) | ||||
| 	err = volume.SetVolumeOwnership(b, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin, nil)) | ||||
| 	if err != nil { | ||||
| 		klog.Errorf("Error applying volume ownership settings for group: %v", mounterArgs.FsGroup) | ||||
| 		return err | ||||
|   | ||||
| @@ -279,7 +279,8 @@ func (c *csiMountMgr) SetUpAt(dir string, mounterArgs volume.MounterArgs) error | ||||
| 	} | ||||
|  | ||||
| 	if c.supportsFSGroup(fsType, mounterArgs.FsGroup, c.fsGroupPolicy) { | ||||
| 		err := volume.SetVolumeOwnership(c, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(c.plugin.GetPluginName())) | ||||
| 		// fullPluginName helps to distinguish different driver from csi plugin | ||||
| 		err := volume.SetVolumeOwnership(c, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(c.plugin, c.spec)) | ||||
| 		if err != nil { | ||||
| 			// At this point mount operation is successful: | ||||
| 			//   1. Since volume can not be used by the pod because of invalid permissions, we must return error | ||||
|   | ||||
| @@ -227,7 +227,7 @@ func (b *downwardAPIVolumeMounter) SetUpAt(dir string, mounterArgs volume.Mounte | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	err = volume.SetVolumeOwnership(b, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin.GetPluginName())) | ||||
| 	err = volume.SetVolumeOwnership(b, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin, nil)) | ||||
| 	if err != nil { | ||||
| 		klog.Errorf("Error applying volume ownership settings for group: %v", mounterArgs.FsGroup) | ||||
| 		return err | ||||
|   | ||||
| @@ -227,7 +227,7 @@ func (ed *emptyDir) SetUpAt(dir string, mounterArgs volume.MounterArgs) error { | ||||
| 		err = fmt.Errorf("unknown storage medium %q", ed.medium) | ||||
| 	} | ||||
|  | ||||
| 	volume.SetVolumeOwnership(ed, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(ed.plugin.GetPluginName())) | ||||
| 	volume.SetVolumeOwnership(ed, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(ed.plugin, nil)) | ||||
|  | ||||
| 	// If setting up the quota fails, just log a message but don't actually error out. | ||||
| 	// We'll use the old du mechanism in this case, at least until we support | ||||
|   | ||||
| @@ -91,7 +91,7 @@ func diskSetUp(manager diskManager, b fcDiskMounter, volPath string, mounter mou | ||||
| 	} | ||||
|  | ||||
| 	if !b.readOnly { | ||||
| 		volume.SetVolumeOwnership(&b, fsGroup, fsGroupChangePolicy, util.FSGroupCompleteHook(b.plugin.GetPluginName())) | ||||
| 		volume.SetVolumeOwnership(&b, fsGroup, fsGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
|   | ||||
| @@ -94,7 +94,8 @@ func (f *flexVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) | ||||
|  | ||||
| 	if !f.readOnly { | ||||
| 		if f.plugin.capabilities.FSGroup { | ||||
| 			volume.SetVolumeOwnership(f, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(f.plugin.GetPluginName())) | ||||
| 			// fullPluginName helps to distinguish different driver from flex volume plugin | ||||
| 			volume.SetVolumeOwnership(f, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(f.plugin, f.spec)) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -362,7 +362,7 @@ func (b *flockerVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArg | ||||
| 	} | ||||
|  | ||||
| 	if !b.readOnly { | ||||
| 		volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin.GetPluginName())) | ||||
| 		volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) | ||||
| 	} | ||||
|  | ||||
| 	klog.V(4).Infof("successfully mounted %s", dir) | ||||
|   | ||||
| @@ -429,7 +429,7 @@ func (b *gcePersistentDiskMounter) SetUpAt(dir string, mounterArgs volume.Mounte | ||||
| 	} | ||||
|  | ||||
| 	if !b.readOnly { | ||||
| 		volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin.GetPluginName())) | ||||
| 		volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|   | ||||
| @@ -236,7 +236,7 @@ func (b *gitRepoVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArg | ||||
| 		return fmt.Errorf("failed to exec 'git reset --hard': %s: %v", output, err) | ||||
| 	} | ||||
|  | ||||
| 	volume.SetVolumeOwnership(b, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin.GetPluginName())) | ||||
| 	volume.SetVolumeOwnership(b, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin, nil)) | ||||
|  | ||||
| 	volumeutil.SetReady(b.getMetaDir()) | ||||
| 	return nil | ||||
|   | ||||
| @@ -96,7 +96,7 @@ func diskSetUp(manager diskManager, b iscsiDiskMounter, volPath string, mounter | ||||
| 	} | ||||
|  | ||||
| 	if !b.readOnly { | ||||
| 		volume.SetVolumeOwnership(&b, fsGroup, fsGroupChangePolicy, util.FSGroupCompleteHook(b.plugin.GetPluginName())) | ||||
| 		volume.SetVolumeOwnership(&b, fsGroup, fsGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
|   | ||||
| @@ -566,7 +566,7 @@ func (m *localVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) | ||||
| 	if !m.readOnly { | ||||
| 		// Volume owner will be written only once on the first volume mount | ||||
| 		if len(refs) == 0 { | ||||
| 			return volume.SetVolumeOwnership(m, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(m.plugin.GetPluginName())) | ||||
| 			return volume.SetVolumeOwnership(m, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(m.plugin, nil)) | ||||
| 		} | ||||
| 	} | ||||
| 	return nil | ||||
|   | ||||
| @@ -328,7 +328,7 @@ func (b *portworxVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterAr | ||||
| 		return err | ||||
| 	} | ||||
| 	if !b.readOnly { | ||||
| 		volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin.GetPluginName())) | ||||
| 		volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) | ||||
| 	} | ||||
| 	klog.Infof("Portworx Volume %s setup at %s", b.volumeID, dir) | ||||
| 	return nil | ||||
|   | ||||
| @@ -237,7 +237,7 @@ func (s *projectedVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterA | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	err = volume.SetVolumeOwnership(s, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(s.plugin.GetPluginName())) | ||||
| 	err = volume.SetVolumeOwnership(s, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(s.plugin, nil)) | ||||
| 	if err != nil { | ||||
| 		klog.Errorf("Error applying volume ownership settings for group: %v", mounterArgs.FsGroup) | ||||
| 		return err | ||||
|   | ||||
| @@ -96,7 +96,7 @@ func diskSetUp(manager diskManager, b rbdMounter, volPath string, mounter mount. | ||||
| 	klog.V(3).Infof("rbd: successfully bind mount %s to %s with options %v", globalPDPath, volPath, mountOptions) | ||||
|  | ||||
| 	if !b.ReadOnly { | ||||
| 		volume.SetVolumeOwnership(&b, fsGroup, fsGroupChangePolicy, util.FSGroupCompleteHook(b.plugin.GetPluginName())) | ||||
| 		volume.SetVolumeOwnership(&b, fsGroup, fsGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
|   | ||||
| @@ -161,7 +161,7 @@ func (v *sioVolume) SetUpAt(dir string, mounterArgs volume.MounterArgs) error { | ||||
|  | ||||
| 	if !v.readOnly && mounterArgs.FsGroup != nil { | ||||
| 		klog.V(4).Info(log("applying  value FSGroup ownership")) | ||||
| 		volume.SetVolumeOwnership(v, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(v.plugin.GetPluginName())) | ||||
| 		volume.SetVolumeOwnership(v, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(v.plugin, v.spec)) | ||||
| 	} | ||||
|  | ||||
| 	klog.V(4).Info(log("successfully setup PV %s: volume %s mapped as %s mounted at %s", v.volSpecName, v.volName, devicePath, dir)) | ||||
|   | ||||
| @@ -251,7 +251,7 @@ func (b *secretVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	err = volume.SetVolumeOwnership(b, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin.GetPluginName())) | ||||
| 	err = volume.SetVolumeOwnership(b, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin, nil)) | ||||
| 	if err != nil { | ||||
| 		klog.Errorf("Error applying volume ownership settings for group: %v", mounterArgs.FsGroup) | ||||
| 		return err | ||||
|   | ||||
| @@ -430,7 +430,7 @@ func (b *storageosMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) e | ||||
| 	} | ||||
|  | ||||
| 	if !b.readOnly { | ||||
| 		volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin.GetPluginName())) | ||||
| 		volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) | ||||
| 	} | ||||
| 	klog.V(4).Infof("StorageOS volume setup complete on %s", dir) | ||||
| 	return nil | ||||
|   | ||||
| @@ -22,6 +22,7 @@ go_library( | ||||
|         "//pkg/api/legacyscheme:go_default_library", | ||||
|         "//pkg/api/v1/pod:go_default_library", | ||||
|         "//pkg/apis/core/v1/helper:go_default_library", | ||||
|         "//pkg/features:go_default_library", | ||||
|         "//pkg/securitycontext:go_default_library", | ||||
|         "//pkg/util/resizefs:go_default_library", | ||||
|         "//pkg/volume:go_default_library", | ||||
| @@ -37,6 +38,7 @@ go_library( | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/util/strategicpatch:go_default_library", | ||||
|         "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library", | ||||
|         "//staging/src/k8s.io/client-go/kubernetes:go_default_library", | ||||
|         "//staging/src/k8s.io/component-base/metrics:go_default_library", | ||||
|         "//staging/src/k8s.io/component-base/metrics/legacyregistry:go_default_library", | ||||
| @@ -54,6 +56,7 @@ go_test( | ||||
|         "atomic_writer_test.go", | ||||
|         "attach_limit_test.go", | ||||
|         "device_util_linux_test.go", | ||||
|         "metrics_test.go", | ||||
|         "nested_volumes_test.go", | ||||
|         "resize_util_test.go", | ||||
|         "util_test.go", | ||||
|   | ||||
| @@ -20,8 +20,10 @@ import ( | ||||
| 	"fmt" | ||||
| 	"time" | ||||
|  | ||||
| 	utilfeature "k8s.io/apiserver/pkg/util/feature" | ||||
| 	"k8s.io/component-base/metrics" | ||||
| 	"k8s.io/component-base/metrics/legacyregistry" | ||||
| 	"k8s.io/kubernetes/pkg/features" | ||||
| 	"k8s.io/kubernetes/pkg/volume" | ||||
| ) | ||||
|  | ||||
| @@ -110,8 +112,8 @@ func OperationCompleteHook(plugin, operationName string) func(*error) { | ||||
| } | ||||
|  | ||||
| // FSGroupCompleteHook returns a hook to call when volume recursive permission is changed | ||||
| func FSGroupCompleteHook(pluginName string) func(*error) { | ||||
| 	return OperationCompleteHook(pluginName, "volume_fsgroup_recursive_apply") | ||||
| func FSGroupCompleteHook(plugin volume.VolumePlugin, spec *volume.Spec) func(*error) { | ||||
| 	return OperationCompleteHook(GetFullQualifiedPluginNameForVolume(plugin.GetPluginName(), spec), "volume_fsgroup_recursive_apply") | ||||
| } | ||||
|  | ||||
| // GetFullQualifiedPluginNameForVolume returns full qualified plugin name for | ||||
| @@ -120,9 +122,14 @@ func FSGroupCompleteHook(pluginName string) func(*error) { | ||||
| // between metrics emitted for CSI volumes which may be handled by different | ||||
| // CSI plugin drivers. | ||||
| func GetFullQualifiedPluginNameForVolume(pluginName string, spec *volume.Spec) string { | ||||
| 	if spec != nil && spec.PersistentVolume != nil && spec.PersistentVolume.Spec.CSI != nil { | ||||
| 	if spec != nil { | ||||
| 		if spec.Volume != nil && spec.Volume.CSI != nil && utilfeature.DefaultFeatureGate.Enabled(features.CSIInlineVolume) { | ||||
| 			return fmt.Sprintf("%s:%s", pluginName, spec.Volume.CSI.Driver) | ||||
| 		} | ||||
| 		if spec.PersistentVolume != nil && spec.PersistentVolume.Spec.CSI != nil { | ||||
| 			return fmt.Sprintf("%s:%s", pluginName, spec.PersistentVolume.Spec.CSI.Driver) | ||||
| 		} | ||||
| 	} | ||||
| 	return pluginName | ||||
| } | ||||
|  | ||||
|   | ||||
							
								
								
									
										91
									
								
								pkg/volume/util/metrics_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										91
									
								
								pkg/volume/util/metrics_test.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,91 @@ | ||||
| /* | ||||
| Copyright 2020 The Kubernetes Authors. | ||||
|  | ||||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| you may not use this file except in compliance with the License. | ||||
| You may obtain a copy of the License at | ||||
|  | ||||
|     http://www.apache.org/licenses/LICENSE-2.0 | ||||
|  | ||||
| Unless required by applicable law or agreed to in writing, software | ||||
| distributed under the License is distributed on an "AS IS" BASIS, | ||||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| See the License for the specific language governing permissions and | ||||
| limitations under the License. | ||||
| */ | ||||
|  | ||||
| package util | ||||
|  | ||||
| import ( | ||||
| 	"fmt" | ||||
| 	"testing" | ||||
|  | ||||
| 	v1 "k8s.io/api/core/v1" | ||||
| 	"k8s.io/kubernetes/pkg/volume" | ||||
| ) | ||||
|  | ||||
| func TestGetFullQualifiedPluginNameForVolume(t *testing.T) { | ||||
| 	var ( | ||||
| 		fakePluginName          = "kubernetes.io/fakePlugin" | ||||
| 		fakeInlineCSIDriverName = "fake.inline.csi.driver" | ||||
| 		fakeCSIDriverName       = "fake.csi.driver" | ||||
| 	) | ||||
|  | ||||
| 	testCase := []struct { | ||||
| 		name         string | ||||
| 		pluginName   string | ||||
| 		spec         *volume.Spec | ||||
| 		wantFullName string | ||||
| 	}{ | ||||
| 		{ | ||||
| 			name:         "get full qualified plugin name without volume spec", | ||||
| 			pluginName:   fakePluginName, | ||||
| 			spec:         nil, | ||||
| 			wantFullName: fakePluginName, | ||||
| 		}, | ||||
| 		{ | ||||
| 			name:         "get full qualified plugin name without using CSI plugin", | ||||
| 			pluginName:   fakePluginName, | ||||
| 			spec:         &volume.Spec{}, | ||||
| 			wantFullName: fakePluginName, | ||||
| 		}, | ||||
| 		{ | ||||
| 			name:       "get full qualified plugin name with CSI ephemeral volume", | ||||
| 			pluginName: fakePluginName, | ||||
| 			spec: &volume.Spec{ | ||||
| 				Volume: &v1.Volume{ | ||||
| 					VolumeSource: v1.VolumeSource{ | ||||
| 						CSI: &v1.CSIVolumeSource{ | ||||
| 							Driver: fakeInlineCSIDriverName, | ||||
| 						}, | ||||
| 					}, | ||||
| 				}, | ||||
| 			}, | ||||
| 			wantFullName: fmt.Sprintf("%s:%s", fakePluginName, fakeInlineCSIDriverName), | ||||
| 		}, | ||||
| 		{ | ||||
| 			name:       "get full qualified plugin name with CSI PV", | ||||
| 			pluginName: fakePluginName, | ||||
| 			spec: &volume.Spec{ | ||||
| 				PersistentVolume: &v1.PersistentVolume{ | ||||
| 					Spec: v1.PersistentVolumeSpec{ | ||||
| 						PersistentVolumeSource: v1.PersistentVolumeSource{ | ||||
| 							CSI: &v1.CSIPersistentVolumeSource{ | ||||
| 								Driver: fakeCSIDriverName, | ||||
| 							}, | ||||
| 						}, | ||||
| 					}, | ||||
| 				}, | ||||
| 			}, | ||||
| 			wantFullName: fmt.Sprintf("%s:%s", fakePluginName, fakeCSIDriverName), | ||||
| 		}, | ||||
| 	} | ||||
|  | ||||
| 	for _, test := range testCase { | ||||
| 		t.Run(test.name, func(t *testing.T) { | ||||
| 			if fullPluginName := GetFullQualifiedPluginNameForVolume(test.pluginName, test.spec); fullPluginName != test.wantFullName { | ||||
| 				t.Errorf("Case name: %s, GetFullQualifiedPluginNameForVolume, pluginName:%s, spec: %v, return:%s, want:%s", test.name, test.pluginName, test.spec, fullPluginName, test.wantFullName) | ||||
| 			} | ||||
| 		}) | ||||
| 	} | ||||
| } | ||||
| @@ -278,7 +278,7 @@ func (b *vsphereVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArg | ||||
| 		os.Remove(dir) | ||||
| 		return err | ||||
| 	} | ||||
| 	volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin.GetPluginName())) | ||||
| 	volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) | ||||
| 	klog.V(3).Infof("vSphere volume %s mounted to %s", b.volPath, dir) | ||||
|  | ||||
| 	return nil | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Kubernetes Prow Robot
					Kubernetes Prow Robot