mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Remove selected IP from backup-volfile-servers list to avoid warning in mount logs.
This commit is contained in:
parent
8f4cc7d81f
commit
63cb1d65ca
@ -371,8 +371,18 @@ func (b *glusterfsMounter) setUpAtInternal(dir string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Add backup-volfile-servers and auto_unmount options.
|
if (len(addrlist) > 0) && (addrlist[0] != "") {
|
||||||
|
ip := addrlist[rand.Intn(len(addrlist))]
|
||||||
|
|
||||||
|
// Add backup-volfile-servers and auto_unmount options.
|
||||||
|
// When ip is also in backup-volfile-servers, there will be a warning:
|
||||||
|
// "gf_remember_backup_volfile_server] 0-glusterfs: failed to set volfile server: File exists".
|
||||||
|
addr.Delete(ip)
|
||||||
|
backups := addr.List()
|
||||||
|
// Avoid an invalid empty backup-volfile-servers option.
|
||||||
|
if len(backups) > 0 {
|
||||||
options = append(options, "backup-volfile-servers="+dstrings.Join(addrlist[:], ":"))
|
options = append(options, "backup-volfile-servers="+dstrings.Join(addrlist[:], ":"))
|
||||||
|
}
|
||||||
options = append(options, "auto_unmount")
|
options = append(options, "auto_unmount")
|
||||||
|
|
||||||
mountOptions := volutil.JoinMountOptions(b.mountOptions, options)
|
mountOptions := volutil.JoinMountOptions(b.mountOptions, options)
|
||||||
@ -381,8 +391,6 @@ func (b *glusterfsMounter) setUpAtInternal(dir string) error {
|
|||||||
// will fetch all the servers mentioned in the backup-volfile-servers list.
|
// will fetch all the servers mentioned in the backup-volfile-servers list.
|
||||||
// Refer to backup-volfile-servers @ http://docs.gluster.org/en/latest/Administrator%20Guide/Setting%20Up%20Clients/
|
// Refer to backup-volfile-servers @ http://docs.gluster.org/en/latest/Administrator%20Guide/Setting%20Up%20Clients/
|
||||||
|
|
||||||
if (len(addrlist) > 0) && (addrlist[0] != "") {
|
|
||||||
ip := addrlist[rand.Intn(len(addrlist))]
|
|
||||||
errs = b.mounter.Mount(ip+":"+b.path, dir, "glusterfs", mountOptions)
|
errs = b.mounter.Mount(ip+":"+b.path, dir, "glusterfs", mountOptions)
|
||||||
if errs == nil {
|
if errs == nil {
|
||||||
klog.Infof("successfully mounted directory %s", dir)
|
klog.Infof("successfully mounted directory %s", dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user