mirror of https://github.com/k3s-io/k3s
doTestPlugin func delete volumePath in nfsvolume
parent
2296c73292
commit
91ddc79472
|
@ -120,17 +120,16 @@ func doTestPlugin(t *testing.T, spec *volume.Spec) {
|
||||||
fake := &mount.FakeMounter{}
|
fake := &mount.FakeMounter{}
|
||||||
pod := &v1.Pod{ObjectMeta: metav1.ObjectMeta{UID: types.UID("poduid")}}
|
pod := &v1.Pod{ObjectMeta: metav1.ObjectMeta{UID: types.UID("poduid")}}
|
||||||
mounter, err := plug.(*nfsPlugin).newMounterInternal(spec, pod, fake)
|
mounter, err := plug.(*nfsPlugin).newMounterInternal(spec, pod, fake)
|
||||||
volumePath := mounter.GetPath()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Failed to make a new Mounter: %v", err)
|
t.Errorf("Failed to make a new Mounter: %v", err)
|
||||||
}
|
}
|
||||||
if mounter == nil {
|
if mounter == nil {
|
||||||
t.Errorf("Got a nil Mounter")
|
t.Errorf("Got a nil Mounter")
|
||||||
}
|
}
|
||||||
path := mounter.GetPath()
|
volumePath := mounter.GetPath()
|
||||||
expectedPath := fmt.Sprintf("%s/pods/poduid/volumes/kubernetes.io~nfs/vol1", tmpDir)
|
expectedPath := fmt.Sprintf("%s/pods/poduid/volumes/kubernetes.io~nfs/vol1", tmpDir)
|
||||||
if path != expectedPath {
|
if volumePath != expectedPath {
|
||||||
t.Errorf("Unexpected path, expected %q, got: %q", expectedPath, path)
|
t.Errorf("Unexpected path, expected %q, got: %q", expectedPath, volumePath)
|
||||||
}
|
}
|
||||||
if err := mounter.SetUp(nil); err != nil {
|
if err := mounter.SetUp(nil); err != nil {
|
||||||
t.Errorf("Expected success, got: %v", err)
|
t.Errorf("Expected success, got: %v", err)
|
||||||
|
|
Loading…
Reference in New Issue