Apply latest changes from copy-and-pasted gce_pd

This commit is contained in:
Justin Santa Barbara 2015-04-07 15:35:43 -07:00
parent 9711e771c5
commit a20484b5ed
3 changed files with 8 additions and 8 deletions

View File

@ -174,7 +174,7 @@ func (pd *awsElasticBlockStore) SetUp() error {
// SetUpAt attaches the disk and bind mounts to the volume path.
func (pd *awsElasticBlockStore) SetUpAt(dir string) error {
// 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)
if err != nil && !os.IsNotExist(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.
err = pd.mounter.Mount(globalPDPath, dir, "", mount.FlagBind|flags, "")
if err != nil {
mountpoint, mntErr := mount.IsMountPoint(dir)
mountpoint, mntErr := pd.mounter.IsMountPoint(dir)
if mntErr != nil {
glog.Errorf("isMountpoint check failed: %v", mntErr)
return err
@ -212,7 +212,7 @@ func (pd *awsElasticBlockStore) SetUpAt(dir string) error {
glog.Errorf("Failed to unmount: %v", mntErr)
return err
}
mountpoint, mntErr := mount.IsMountPoint(dir)
mountpoint, mntErr := pd.mounter.IsMountPoint(dir)
if mntErr != nil {
glog.Errorf("isMountpoint check failed: %v", mntErr)
return err
@ -271,7 +271,7 @@ func (pd *awsElasticBlockStore) TearDown() error {
// Unmounts the bind mount, and detaches the disk only if the PD
// resource was the last reference to that disk on the kubelet.
func (pd *awsElasticBlockStore) TearDownAt(dir string) error {
mountpoint, err := mount.IsMountPoint(dir)
mountpoint, err := pd.mounter.IsMountPoint(dir)
if err != nil {
glog.V(2).Info("Error checking if mountpoint ", dir, ": ", err)
return err
@ -305,7 +305,7 @@ func (pd *awsElasticBlockStore) TearDownAt(dir string) error {
return err
}
}
mountpoint, mntErr := mount.IsMountPoint(dir)
mountpoint, mntErr := pd.mounter.IsMountPoint(dir)
if mntErr != nil {
glog.Errorf("isMountpoint check failed: %v", mntErr)
return err

View File

@ -111,7 +111,7 @@ func TestPlugin(t *testing.T) {
t.Errorf("Failed to make a new Builder: %v", err)
}
if builder == nil {
t.Errorf("Got a nil Builder: %v")
t.Errorf("Got a nil Builder")
}
path := builder.GetPath()
@ -142,7 +142,7 @@ func TestPlugin(t *testing.T) {
t.Errorf("Failed to make a new Cleaner: %v", err)
}
if cleaner == nil {
t.Errorf("Got a nil Cleaner: %v")
t.Errorf("Got a nil Cleaner")
}
if err := cleaner.TearDown(); err != nil {

View File

@ -65,7 +65,7 @@ func (util *AWSDiskUtil) AttachAndMountDisk(pd *awsElasticBlockStore, globalPDPa
}
// Only mount the PD globally once.
mountpoint, err := mount.IsMountPoint(globalPDPath)
mountpoint, err := pd.mounter.IsMountPoint(globalPDPath)
if err != nil {
if os.IsNotExist(err) {
if err := os.MkdirAll(globalPDPath, 0750); err != nil {