Refactor GCE wrapper library to allow execution from E2E test suite
This reverts commit147b6911f5, reversing changes made to6fd986065b.
This commit is contained in:
@@ -132,7 +132,7 @@ func attachDiskAndVerify(b *gcePersistentDiskBuilder, sdBeforeSet sets.String) (
|
||||
glog.Warningf("Retrying attach for GCE PD %q (retry count=%v).", b.pdName, numRetries)
|
||||
}
|
||||
|
||||
if err := gceCloud.AttachDisk(b.pdName, b.readOnly); err != nil {
|
||||
if err := gceCloud.AttachDisk(b.pdName, b.plugin.host.GetHostName(), b.readOnly); err != nil {
|
||||
glog.Errorf("Error attaching PD %q: %v", b.pdName, err)
|
||||
time.Sleep(errorSleepDuration)
|
||||
continue
|
||||
@@ -206,7 +206,7 @@ func detachDiskAndVerify(c *gcePersistentDiskCleaner) {
|
||||
glog.Warningf("Retrying detach for GCE PD %q (retry count=%v).", c.pdName, numRetries)
|
||||
}
|
||||
|
||||
if err := gceCloud.DetachDisk(c.pdName); err != nil {
|
||||
if err := gceCloud.DetachDisk(c.pdName, c.plugin.host.GetHostName()); err != nil {
|
||||
glog.Errorf("Error detaching PD %q: %v", c.pdName, err)
|
||||
time.Sleep(errorSleepDuration)
|
||||
continue
|
||||
|
||||
@@ -156,6 +156,9 @@ type VolumeHost interface {
|
||||
|
||||
// Get writer interface for writing data to disk.
|
||||
GetWriter() io.Writer
|
||||
|
||||
// Returns the hostname of the host kubelet is running on
|
||||
GetHostName() string
|
||||
}
|
||||
|
||||
// VolumePluginMgr tracks registered plugins.
|
||||
|
||||
@@ -92,6 +92,11 @@ func (f *fakeVolumeHost) NewWrapperCleaner(spec *Spec, podUID types.UID) (Cleane
|
||||
return plug.NewCleaner(spec.Name(), podUID)
|
||||
}
|
||||
|
||||
// Returns the hostname of the host kubelet is running on
|
||||
func (f *fakeVolumeHost) GetHostName() string {
|
||||
return "fakeHostName"
|
||||
}
|
||||
|
||||
func ProbeVolumePlugins(config VolumeConfig) []VolumePlugin {
|
||||
if _, ok := config.OtherAttributes["fake-property"]; ok {
|
||||
return []VolumePlugin{
|
||||
|
||||
Reference in New Issue
Block a user