Merge pull request #46352 from humblec/gluster-mount-4

Automatic merge from submit-queue (batch tested with PRs 45913, 46065, 46352, 46363, 46373)

Dont exit if 'mount.glusterfs -V' resulted in an error.
This commit is contained in:
Kubernetes Submit Queue 2017-05-25 00:11:03 -07:00 committed by GitHub
commit f5bdd61b12

View File

@ -379,6 +379,7 @@ func (b *glusterfsMounter) setUpAtInternal(dir string) error {
}
options = append(options, "backup-volfile-servers="+dstrings.Join(addrlist[:], ":"))
mountOptions := volume.JoinMountOptions(b.mountOptions, options)
//fetch client version.
mountBinaryVerStr := ""
@ -386,8 +387,8 @@ func (b *glusterfsMounter) setUpAtInternal(dir string) error {
cmdOut, err := b.exe.Command(linuxGlusterMountBinary, "-V").CombinedOutput()
if err != nil {
return fmt.Errorf("Failed to get binary %s version", linuxGlusterMountBinary)
}
glog.Warningf("Failed to get binary %q version", linuxGlusterMountBinary)
} else {
//cmdOut will be filled as shown below.
/*
[root@]# mount.glusterfs -V
@ -419,13 +420,12 @@ func (b *glusterfsMounter) setUpAtInternal(dir string) error {
}
}
mountOptions := volume.JoinMountOptions(b.mountOptions, options)
for i := len(mountOptions) - 1; i >= 0; i-- {
if mountOptions[i] == "auto_unmount" && mountBinaryVerStr != "" && mountBinaryVerStr < autoUnmountBinaryVer {
mountOptions = append(mountOptions[:i], mountOptions[i+1:]...)
}
}
}
// Avoid mount storm, pick a host randomly.
// Iterate all hosts until mount succeeds.