remove volumeoptions from VolumePlugin and BlockVolumePlugin

This commit is contained in:
carlory
2024-05-23 19:21:54 +08:00
parent 57d197fb89
commit c4851c64a0
46 changed files with 112 additions and 147 deletions

View File

@@ -241,7 +241,7 @@ func TestInvalidLocalPath(t *testing.T) {
defer os.RemoveAll(tmpDir)
pod := &v1.Pod{ObjectMeta: metav1.ObjectMeta{UID: types.UID("poduid")}}
mounter, err := plug.NewMounter(getTestVolume(false, "/no/backsteps/allowed/..", false, nil), pod, volume.VolumeOptions{})
mounter, err := plug.NewMounter(getTestVolume(false, "/no/backsteps/allowed/..", false, nil), pod)
if err != nil {
t.Fatal(err)
}
@@ -361,7 +361,7 @@ func TestMountUnmount(t *testing.T) {
defer os.RemoveAll(tmpDir)
pod := &v1.Pod{ObjectMeta: metav1.ObjectMeta{UID: types.UID("poduid")}}
mounter, err := plug.NewMounter(getTestVolume(false, tmpDir, false, nil), pod, volume.VolumeOptions{})
mounter, err := plug.NewMounter(getTestVolume(false, tmpDir, false, nil), pod)
if err != nil {
t.Errorf("Failed to make a new Mounter: %v", err)
}
@@ -415,7 +415,7 @@ func TestMapUnmap(t *testing.T) {
pod := &v1.Pod{ObjectMeta: metav1.ObjectMeta{UID: types.UID("poduid")}}
volSpec := getTestVolume(false, tmpDir, true /*isBlock*/, nil)
mapper, err := plug.NewBlockVolumeMapper(volSpec, pod, volume.VolumeOptions{})
mapper, err := plug.NewBlockVolumeMapper(volSpec, pod)
if err != nil {
t.Errorf("Failed to make a new Mounter: %v", err)
}
@@ -480,7 +480,7 @@ func TestMapUnmap(t *testing.T) {
}
func testFSGroupMount(plug volume.VolumePlugin, pod *v1.Pod, tmpDir string, fsGroup int64) error {
mounter, err := plug.NewMounter(getTestVolume(false, tmpDir, false, nil), pod, volume.VolumeOptions{})
mounter, err := plug.NewMounter(getTestVolume(false, tmpDir, false, nil), pod)
if err != nil {
return err
}
@@ -642,7 +642,7 @@ func TestMountOptions(t *testing.T) {
defer os.RemoveAll(tmpDir)
pod := &v1.Pod{ObjectMeta: metav1.ObjectMeta{UID: types.UID("poduid")}}
mounter, err := plug.NewMounter(getTestVolume(false, tmpDir, false, []string{"test-option"}), pod, volume.VolumeOptions{})
mounter, err := plug.NewMounter(getTestVolume(false, tmpDir, false, []string{"test-option"}), pod)
if err != nil {
t.Errorf("Failed to make a new Mounter: %v", err)
}
@@ -670,7 +670,7 @@ func TestPersistentClaimReadOnlyFlag(t *testing.T) {
// Read only == true
pod := &v1.Pod{ObjectMeta: metav1.ObjectMeta{UID: types.UID("poduid")}}
mounter, err := plug.NewMounter(getTestVolume(true, tmpDir, false, nil), pod, volume.VolumeOptions{})
mounter, err := plug.NewMounter(getTestVolume(true, tmpDir, false, nil), pod)
if err != nil {
t.Errorf("Failed to make a new Mounter: %v", err)
}
@@ -682,7 +682,7 @@ func TestPersistentClaimReadOnlyFlag(t *testing.T) {
}
// Read only == false
mounter, err = plug.NewMounter(getTestVolume(false, tmpDir, false, nil), pod, volume.VolumeOptions{})
mounter, err = plug.NewMounter(getTestVolume(false, tmpDir, false, nil), pod)
if err != nil {
t.Errorf("Failed to make a new Mounter: %v", err)
}
@@ -731,7 +731,7 @@ func TestFilterPodMounts(t *testing.T) {
defer os.RemoveAll(tmpDir)
pod := &v1.Pod{ObjectMeta: metav1.ObjectMeta{UID: types.UID("poduid")}}
mounter, err := plug.NewMounter(getTestVolume(false, tmpDir, false, nil), pod, volume.VolumeOptions{})
mounter, err := plug.NewMounter(getTestVolume(false, tmpDir, false, nil), pod)
if err != nil {
t.Fatal(err)
}