add or fix some errors return statements and ineffassign

Signed-off-by: haoshuwei <haoshuwei24@gmail.com>
This commit is contained in:
haoshuwei
2019-09-14 09:26:17 +08:00
parent 52626339b1
commit b752997036
5 changed files with 16 additions and 2 deletions

View File

@@ -267,11 +267,17 @@ func TestMounterAndUnmounterTypeAssert(t *testing.T) {
fake := &mount.FakeMounter{}
pod := &v1.Pod{ObjectMeta: metav1.ObjectMeta{UID: types.UID("poduid")}}
mounter, err := plug.(*azureFilePlugin).newMounterInternal(volume.NewSpecFromVolume(spec), pod, &fakeAzureSvc{}, fake)
if err != nil {
t.Errorf("MounterInternal() failed: %v", err)
}
if _, ok := mounter.(volume.Unmounter); ok {
t.Errorf("Volume Mounter can be type-assert to Unmounter")
}
unmounter, err := plug.(*azureFilePlugin).newUnmounterInternal("vol1", types.UID("poduid"), &mount.FakeMounter{})
if err != nil {
t.Errorf("MounterInternal() failed: %v", err)
}
if _, ok := unmounter.(volume.Mounter); ok {
t.Errorf("Volume Unmounter can be type-assert to Mounter")
}