mirror of https://github.com/k3s-io/k3s
check function return err
parent
622386e531
commit
b6e1fecde7
|
@ -232,7 +232,10 @@ func (cephfsVolume *cephfsMounter) SetUpAt(dir string, fsGroup *int64) error {
|
||||||
if !notMnt {
|
if !notMnt {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
os.MkdirAll(dir, 0750)
|
|
||||||
|
if err := os.MkdirAll(dir, 0750); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// check whether it belongs to fuse, if not, default to use kernel mount.
|
// check whether it belongs to fuse, if not, default to use kernel mount.
|
||||||
if cephfsVolume.checkFuseMount() {
|
if cephfsVolume.checkFuseMount() {
|
||||||
|
@ -253,6 +256,7 @@ func (cephfsVolume *cephfsMounter) SetUpAt(dir string, fsGroup *int64) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
glog.V(4).Infof("CephFS kernel mount.")
|
glog.V(4).Infof("CephFS kernel mount.")
|
||||||
|
|
||||||
err = cephfsVolume.execMount(dir)
|
err = cephfsVolume.execMount(dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// cleanup upon failure.
|
// cleanup upon failure.
|
||||||
|
|
|
@ -259,8 +259,9 @@ func (b *glusterfsMounter) SetUpAt(dir string, fsGroup *int64) error {
|
||||||
if !notMnt {
|
if !notMnt {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if err := os.MkdirAll(dir, 0750); err != nil {
|
||||||
os.MkdirAll(dir, 0750)
|
return err
|
||||||
|
}
|
||||||
err = b.setUpAtInternal(dir)
|
err = b.setUpAtInternal(dir)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue