@@ -32,7 +32,7 @@ import (
32
32
utilstrings "k8s.io/utils/strings"
33
33
)
34
34
35
- // This is the primary entrypoint for volume plugins.
35
+ // ProbeVolumePlugins is the primary entrypoint for volume plugins.
36
36
// The volumeConfig arg provides the ability to configure recycler behavior. It is implemented as a pointer to allow nils.
37
37
// The nfsPlugin is used to store the volumeConfig and give it, when needed, to the func that creates NFS Recyclers.
38
38
// Tests that exercise recycling should not use this func but instead use ProbeRecyclablePlugins() to override default behavior.
@@ -224,21 +224,21 @@ type nfsMounter struct {
224
224
225
225
var _ volume.Mounter = & nfsMounter {}
226
226
227
- func (b * nfsMounter ) GetAttributes () volume.Attributes {
227
+ func (nfsMounter * nfsMounter ) GetAttributes () volume.Attributes {
228
228
return volume.Attributes {
229
- ReadOnly : b .readOnly ,
229
+ ReadOnly : nfsMounter .readOnly ,
230
230
Managed : false ,
231
231
SupportsSELinux : false ,
232
232
}
233
233
}
234
234
235
235
// SetUp attaches the disk and bind mounts to the volume path.
236
- func (b * nfsMounter ) SetUp (fsGroup * int64 ) error {
237
- return b .SetUpAt (b .GetPath (), fsGroup )
236
+ func (nfsMounter * nfsMounter ) SetUp (fsGroup * int64 ) error {
237
+ return nfsMounter .SetUpAt (nfsMounter .GetPath (), fsGroup )
238
238
}
239
239
240
- func (b * nfsMounter ) SetUpAt (dir string , fsGroup * int64 ) error {
241
- notMnt , err := mount .IsNotMountPoint (b .mounter , dir )
240
+ func (nfsMounter * nfsMounter ) SetUpAt (dir string , fsGroup * int64 ) error {
241
+ notMnt , err := mount .IsNotMountPoint (nfsMounter .mounter , dir )
242
242
klog .V (4 ).Infof ("NFS mount set up: %s %v %v" , dir , ! notMnt , err )
243
243
if err != nil && ! os .IsNotExist (err ) {
244
244
return err
@@ -249,25 +249,25 @@ func (b *nfsMounter) SetUpAt(dir string, fsGroup *int64) error {
249
249
if err := os .MkdirAll (dir , 0750 ); err != nil {
250
250
return err
251
251
}
252
- source := fmt .Sprintf ("%s:%s" , b .server , b .exportPath )
252
+ source := fmt .Sprintf ("%s:%s" , nfsMounter .server , nfsMounter .exportPath )
253
253
options := []string {}
254
- if b .readOnly {
254
+ if nfsMounter .readOnly {
255
255
options = append (options , "ro" )
256
256
}
257
- mountOptions := util .JoinMountOptions (b .mountOptions , options )
258
- err = b .mounter .Mount (source , dir , "nfs" , mountOptions )
257
+ mountOptions := util .JoinMountOptions (nfsMounter .mountOptions , options )
258
+ err = nfsMounter .mounter .Mount (source , dir , "nfs" , mountOptions )
259
259
if err != nil {
260
- notMnt , mntErr := mount .IsNotMountPoint (b .mounter , dir )
260
+ notMnt , mntErr := mount .IsNotMountPoint (nfsMounter .mounter , dir )
261
261
if mntErr != nil {
262
262
klog .Errorf ("IsNotMountPoint check failed: %v" , mntErr )
263
263
return err
264
264
}
265
265
if ! notMnt {
266
- if mntErr = b .mounter .Unmount (dir ); mntErr != nil {
266
+ if mntErr = nfsMounter .mounter .Unmount (dir ); mntErr != nil {
267
267
klog .Errorf ("Failed to unmount: %v" , mntErr )
268
268
return err
269
269
}
270
- notMnt , mntErr := mount .IsNotMountPoint (b .mounter , dir )
270
+ notMnt , mntErr := mount .IsNotMountPoint (nfsMounter .mounter , dir )
271
271
if mntErr != nil {
272
272
klog .Errorf ("IsNotMountPoint check failed: %v" , mntErr )
273
273
return err
0 commit comments