mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-06 08:15:48 -04:00
helm: fix upgrade command unintentionally skipping all service upgrades (#1992)
* Fix usage of errors.As in upgrade command implementation * Use struct pointers when working with custom errors --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
5a9f9c0a52
commit
d95ddd01d3
10 changed files with 38 additions and 44 deletions
|
@ -108,12 +108,13 @@ func TestUpload(t *testing.T) {
|
|||
}
|
||||
_, err := client.Upload(context.Background(), tc.in)
|
||||
|
||||
var invalidationErr *InvalidationError
|
||||
if tc.wantCacheInvalidationErr {
|
||||
assert.ErrorAs(err, &InvalidationError{})
|
||||
assert.ErrorAs(err, &invalidationErr)
|
||||
return
|
||||
}
|
||||
if tc.wantErr {
|
||||
assert.False(errors.As(err, &InvalidationError{}))
|
||||
assert.False(errors.As(err, &invalidationErr))
|
||||
assert.Error(err)
|
||||
return
|
||||
}
|
||||
|
@ -218,12 +219,13 @@ func TestDeleteObject(t *testing.T) {
|
|||
}
|
||||
_, err := client.DeleteObject(context.Background(), newObjectInput(tc.nilInput, tc.nilKey))
|
||||
|
||||
var invalidationErr *InvalidationError
|
||||
if tc.wantCacheInvalidationErr {
|
||||
assert.ErrorAs(err, &InvalidationError{})
|
||||
assert.ErrorAs(err, &invalidationErr)
|
||||
return
|
||||
}
|
||||
if tc.wantErr {
|
||||
assert.False(errors.As(err, &InvalidationError{}))
|
||||
assert.False(errors.As(err, &invalidationErr))
|
||||
assert.Error(err)
|
||||
return
|
||||
}
|
||||
|
@ -255,12 +257,13 @@ func TestDeleteObject(t *testing.T) {
|
|||
}
|
||||
_, err := client.DeleteObjects(context.Background(), newObjectsInput(tc.nilInput, tc.nilKey))
|
||||
|
||||
var invalidationErr *InvalidationError
|
||||
if tc.wantCacheInvalidationErr {
|
||||
assert.ErrorAs(err, &InvalidationError{})
|
||||
assert.ErrorAs(err, &invalidationErr)
|
||||
return
|
||||
}
|
||||
if tc.wantErr {
|
||||
assert.False(errors.As(err, &InvalidationError{}))
|
||||
assert.False(errors.As(err, &invalidationErr))
|
||||
assert.Error(err)
|
||||
return
|
||||
}
|
||||
|
@ -396,7 +399,8 @@ func TestFlush(t *testing.T) {
|
|||
err := client.Flush(context.Background())
|
||||
|
||||
if tc.wantCacheInvalidationErr {
|
||||
assert.ErrorAs(err, &InvalidationError{})
|
||||
var invalidationErr *InvalidationError
|
||||
assert.ErrorAs(err, &invalidationErr)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue