Fix unit tests and don't patch with empty finalizers

Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
This commit is contained in:
Grant Griffiths
2021-09-27 15:15:38 -07:00
parent 2039ad9101
commit 3b9f0e2c72
7 changed files with 162 additions and 27 deletions

View File

@@ -162,7 +162,7 @@ func TestSync(t *testing.T) {
expectedSnapshots: newSnapshotArray("snap2-12", "snapuid2-12", "", "content2-12", validSecretClass, "content2-12", &False, nil, nil, newVolumeError("Snapshot failed to bind VolumeSnapshotContent, mock update error"), false, true, nil),
errors: []reactorError{
// Inject error to the forth client.VolumesnapshotV1().VolumeSnapshots().Update call.
{"update", "volumesnapshotcontents", errors.New("mock update error")},
{"patch", "volumesnapshotcontents", errors.New("mock update error")},
},
test: testSyncSnapshot,
},
@@ -312,7 +312,7 @@ func TestSync(t *testing.T) {
initialSecrets: []*v1.Secret{secret()},
errors: []reactorError{
// Inject error to the forth client.VolumesnapshotV1().VolumeSnapshots().Update call.
{"update", "volumesnapshotcontents", errors.New("mock update error")},
{"patch", "volumesnapshotcontents", errors.New("mock update error")},
},
expectSuccess: false,
test: testSyncContentError,