Skip to content

Commit 96439cc

Browse files
authored
Merge pull request kubernetes#82028 from codenrhoden/rename-isbind
Rename mount.IsBind to mount.MakeBindOpts
2 parents 5183669 + ef855c7 commit 96439cc

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

pkg/util/mount/mount.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ func IsNotMountPoint(mounter Interface, file string) (bool, error) {
201201
return notMnt, nil
202202
}
203203

204-
// IsBind detects whether a bind mount is being requested and makes the remount options to
204+
// MakeBindOpts detects whether a bind mount is being requested and makes the remount options to
205205
// use in case of bind mount, due to the fact that bind mount doesn't respect mount options.
206206
// The list equals:
207207
// options - 'bind' + 'remount' (no duplicate)
208-
func IsBind(options []string) (bool, []string, []string) {
208+
func MakeBindOpts(options []string) (bool, []string, []string) {
209209
// Because we have an FD opened on the subpath bind mount, the "bind" option
210210
// needs to be included, otherwise the mount target will error as busy if you
211211
// remount as readonly.

pkg/util/mount/mount_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func (mounter *Mounter) Mount(source string, target string, fstype string, optio
7373
// Path to mounter binary if containerized mounter is needed. Otherwise, it is set to empty.
7474
// All Linux distros are expected to be shipped with a mount utility that a support bind mounts.
7575
mounterPath := ""
76-
bind, bindOpts, bindRemountOpts := IsBind(options)
76+
bind, bindOpts, bindRemountOpts := MakeBindOpts(options)
7777
if bind {
7878
err := mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, bindOpts)
7979
if err != nil {

pkg/util/mount/mount_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"testing"
2222
)
2323

24-
func TestIsBind(t *testing.T) {
24+
func TestMakeBindOpts(t *testing.T) {
2525
tests := []struct {
2626
mountOption []string
2727
isBind bool
@@ -43,7 +43,7 @@ func TestIsBind(t *testing.T) {
4343
},
4444
}
4545
for _, test := range tests {
46-
bind, bindOpts, bindRemountOpts := IsBind(test.mountOption)
46+
bind, bindOpts, bindRemountOpts := MakeBindOpts(test.mountOption)
4747
if bind != test.isBind {
4848
t.Errorf("Expected bind to be %v but got %v", test.isBind, bind)
4949
}

pkg/util/mount/mount_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func (mounter *Mounter) Mount(source string, target string, fstype string, optio
6868
bindSource := source
6969

7070
// tell it's going to mount azure disk or azure file according to options
71-
if bind, _, _ := IsBind(options); bind {
71+
if bind, _, _ := MakeBindOpts(options); bind {
7272
// mount azure disk
7373
bindSource = NormalizeWindowsPath(source)
7474
} else {

pkg/volume/util/exec/exec_mount.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var _ mount.Interface = &execMounter{}
4747

4848
// Mount runs mount(8) using given exec interface.
4949
func (m *execMounter) Mount(source string, target string, fstype string, options []string) error {
50-
bind, bindOpts, bindRemountOpts := mount.IsBind(options)
50+
bind, bindOpts, bindRemountOpts := mount.MakeBindOpts(options)
5151

5252
if bind {
5353
err := m.doExecMount(source, target, fstype, bindOpts)

0 commit comments

Comments
 (0)