mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Apply latest changes from copy-and-pasted gce_pd
This commit is contained in:
parent
9711e771c5
commit
a20484b5ed
@ -174,7 +174,7 @@ func (pd *awsElasticBlockStore) SetUp() error {
|
|||||||
// SetUpAt attaches the disk and bind mounts to the volume path.
|
// SetUpAt attaches the disk and bind mounts to the volume path.
|
||||||
func (pd *awsElasticBlockStore) SetUpAt(dir string) error {
|
func (pd *awsElasticBlockStore) SetUpAt(dir string) error {
|
||||||
// TODO: handle failed mounts here.
|
// TODO: handle failed mounts here.
|
||||||
mountpoint, err := mount.IsMountPoint(dir)
|
mountpoint, err := pd.mounter.IsMountPoint(dir)
|
||||||
glog.V(4).Infof("PersistentDisk set up: %s %v %v", dir, mountpoint, err)
|
glog.V(4).Infof("PersistentDisk set up: %s %v %v", dir, mountpoint, err)
|
||||||
if err != nil && !os.IsNotExist(err) {
|
if err != nil && !os.IsNotExist(err) {
|
||||||
return err
|
return err
|
||||||
@ -202,7 +202,7 @@ func (pd *awsElasticBlockStore) SetUpAt(dir string) error {
|
|||||||
// Perform a bind mount to the full path to allow duplicate mounts of the same PD.
|
// Perform a bind mount to the full path to allow duplicate mounts of the same PD.
|
||||||
err = pd.mounter.Mount(globalPDPath, dir, "", mount.FlagBind|flags, "")
|
err = pd.mounter.Mount(globalPDPath, dir, "", mount.FlagBind|flags, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
mountpoint, mntErr := mount.IsMountPoint(dir)
|
mountpoint, mntErr := pd.mounter.IsMountPoint(dir)
|
||||||
if mntErr != nil {
|
if mntErr != nil {
|
||||||
glog.Errorf("isMountpoint check failed: %v", mntErr)
|
glog.Errorf("isMountpoint check failed: %v", mntErr)
|
||||||
return err
|
return err
|
||||||
@ -212,7 +212,7 @@ func (pd *awsElasticBlockStore) SetUpAt(dir string) error {
|
|||||||
glog.Errorf("Failed to unmount: %v", mntErr)
|
glog.Errorf("Failed to unmount: %v", mntErr)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
mountpoint, mntErr := mount.IsMountPoint(dir)
|
mountpoint, mntErr := pd.mounter.IsMountPoint(dir)
|
||||||
if mntErr != nil {
|
if mntErr != nil {
|
||||||
glog.Errorf("isMountpoint check failed: %v", mntErr)
|
glog.Errorf("isMountpoint check failed: %v", mntErr)
|
||||||
return err
|
return err
|
||||||
@ -271,7 +271,7 @@ func (pd *awsElasticBlockStore) TearDown() error {
|
|||||||
// Unmounts the bind mount, and detaches the disk only if the PD
|
// Unmounts the bind mount, and detaches the disk only if the PD
|
||||||
// resource was the last reference to that disk on the kubelet.
|
// resource was the last reference to that disk on the kubelet.
|
||||||
func (pd *awsElasticBlockStore) TearDownAt(dir string) error {
|
func (pd *awsElasticBlockStore) TearDownAt(dir string) error {
|
||||||
mountpoint, err := mount.IsMountPoint(dir)
|
mountpoint, err := pd.mounter.IsMountPoint(dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.V(2).Info("Error checking if mountpoint ", dir, ": ", err)
|
glog.V(2).Info("Error checking if mountpoint ", dir, ": ", err)
|
||||||
return err
|
return err
|
||||||
@ -305,7 +305,7 @@ func (pd *awsElasticBlockStore) TearDownAt(dir string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mountpoint, mntErr := mount.IsMountPoint(dir)
|
mountpoint, mntErr := pd.mounter.IsMountPoint(dir)
|
||||||
if mntErr != nil {
|
if mntErr != nil {
|
||||||
glog.Errorf("isMountpoint check failed: %v", mntErr)
|
glog.Errorf("isMountpoint check failed: %v", mntErr)
|
||||||
return err
|
return err
|
||||||
|
@ -111,7 +111,7 @@ func TestPlugin(t *testing.T) {
|
|||||||
t.Errorf("Failed to make a new Builder: %v", err)
|
t.Errorf("Failed to make a new Builder: %v", err)
|
||||||
}
|
}
|
||||||
if builder == nil {
|
if builder == nil {
|
||||||
t.Errorf("Got a nil Builder: %v")
|
t.Errorf("Got a nil Builder")
|
||||||
}
|
}
|
||||||
|
|
||||||
path := builder.GetPath()
|
path := builder.GetPath()
|
||||||
@ -142,7 +142,7 @@ func TestPlugin(t *testing.T) {
|
|||||||
t.Errorf("Failed to make a new Cleaner: %v", err)
|
t.Errorf("Failed to make a new Cleaner: %v", err)
|
||||||
}
|
}
|
||||||
if cleaner == nil {
|
if cleaner == nil {
|
||||||
t.Errorf("Got a nil Cleaner: %v")
|
t.Errorf("Got a nil Cleaner")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cleaner.TearDown(); err != nil {
|
if err := cleaner.TearDown(); err != nil {
|
||||||
|
@ -65,7 +65,7 @@ func (util *AWSDiskUtil) AttachAndMountDisk(pd *awsElasticBlockStore, globalPDPa
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only mount the PD globally once.
|
// Only mount the PD globally once.
|
||||||
mountpoint, err := mount.IsMountPoint(globalPDPath)
|
mountpoint, err := pd.mounter.IsMountPoint(globalPDPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
if err := os.MkdirAll(globalPDPath, 0750); err != nil {
|
if err := os.MkdirAll(globalPDPath, 0750); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user