rbd: Use VolumeHost.GetExec() to execute stuff in volume plugins

This commit is contained in:
Jan Safranek
2017-08-22 15:49:21 +02:00
parent 07dea6b447
commit 73b101c14b
4 changed files with 55 additions and 44 deletions

View File

@@ -112,7 +112,8 @@ func doTestPlugin(t *testing.T, spec *volume.Spec) {
}
fdm := NewFakeDiskManager()
defer fdm.Cleanup()
mounter, err := plug.(*rbdPlugin).newMounterInternal(spec, types.UID("poduid"), fdm, &mount.FakeMounter{}, "secrets")
exec := mount.NewFakeExec(nil)
mounter, err := plug.(*rbdPlugin).newMounterInternal(spec, types.UID("poduid"), fdm, &mount.FakeMounter{}, exec, "secrets")
if err != nil {
t.Errorf("Failed to make a new Mounter: %v", err)
}
@@ -137,7 +138,7 @@ func doTestPlugin(t *testing.T, spec *volume.Spec) {
}
}
unmounter, err := plug.(*rbdPlugin).newUnmounterInternal("vol1", types.UID("poduid"), fdm, &mount.FakeMounter{})
unmounter, err := plug.(*rbdPlugin).newUnmounterInternal("vol1", types.UID("poduid"), fdm, &mount.FakeMounter{}, exec)
if err != nil {
t.Errorf("Failed to make a new Unmounter: %v", err)
}