Updated sidecar to not require VolumeSnapshotClass for snapshot deletion
This commit is contained in:
@@ -221,10 +221,11 @@ func TestDeleteSync(t *testing.T) {
|
||||
test: testSyncContent,
|
||||
},
|
||||
{
|
||||
name: "1-4 - fail to delete with a snapshot class which has invalid secret parameter, bound finalizer should remain",
|
||||
initialContents: newContentArrayWithDeletionTimestamp("content1-1", "snapuid1-1", "snap1-1", "sid1-1", "invalid", "", "snap1-4-volumehandle", deletionPolicy, nil, nil, true, &timeNowMetav1),
|
||||
expectedContents: newContentArrayWithDeletionTimestamp("content1-1", "snapuid1-1", "snap1-1", "sid1-1", "invalid", "", "snap1-4-volumehandle", deletionPolicy, nil, nil, true, &timeNowMetav1),
|
||||
expectedEvents: noevents,
|
||||
name: "1-4 - fail to delete with a snapshot class which has invalid secret parameter, bound finalizer should remain",
|
||||
initialContents: newContentArrayWithDeletionTimestamp("content1-1", "snapuid1-1", "snap1-1", "sid1-1", "invalid", "", "snap1-4-volumehandle", deletionPolicy, nil, nil, true, &timeNowMetav1),
|
||||
expectedContents: newContentArrayWithDeletionTimestamp("content1-1", "snapuid1-1", "snap1-1", "sid1-1", "invalid", "", "snap1-4-volumehandle", deletionPolicy, nil, nil, true, &timeNowMetav1),
|
||||
expectedEvents: noevents,
|
||||
expectedDeleteCalls: []deleteCall{{"sid1-1", nil, fmt.Errorf("mock csi driver delete error")}},
|
||||
errors: []reactorError{
|
||||
// Inject error to the first client.VolumesnapshotV1beta1().VolumeSnapshotContents().Delete call.
|
||||
// All other calls will succeed.
|
||||
@@ -336,10 +337,9 @@ func TestDeleteSync(t *testing.T) {
|
||||
test: testSyncContent,
|
||||
},
|
||||
{
|
||||
name: "1-15 - (dynamic)deletion of content with no snapshotclass should produce error",
|
||||
name: "1-15 - (dynamic)deletion of content with no snapshotclass should succeed",
|
||||
initialContents: newContentArrayWithDeletionTimestamp("content1-15", "sid1-15", "snap1-15", "sid1-15", "", "", "snap1-15-volumehandle", deletePolicy, nil, &defaultSize, true, &timeNowMetav1),
|
||||
expectedContents: newContentArrayWithDeletionTimestamp("content1-15", "sid1-15", "snap1-15", "sid1-15", "", "", "snap1-15-volumehandle", deletePolicy, nil, &defaultSize, true, &timeNowMetav1),
|
||||
expectedEvents: []string{"Warning SnapshotDeleteError"},
|
||||
errors: noerrors,
|
||||
expectedDeleteCalls: []deleteCall{{"sid1-15", nil, nil}},
|
||||
test: testSyncContent,
|
||||
|
Reference in New Issue
Block a user