Skip to content

Commit

Permalink
Merge pull request #208 from kaovilai/static-checks
Browse files Browse the repository at this point in the history
static checks
  • Loading branch information
reasonerjt authored Oct 22, 2024
2 parents 882842b + 3d55db3 commit cedace1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion velero-plugin-for-aws/volume_snapshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (b *VolumeSnapshotter) DeleteSnapshot(snapshotID string) error {
// see https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html
var apiErr smithy.APIError
if errors.As(err, &apiErr) {
if "InvalidSnapshot.NotFound" == apiErr.ErrorCode() {
if apiErr.ErrorCode() == "InvalidSnapshot.NotFound" {
return nil
}
}
Expand Down
8 changes: 4 additions & 4 deletions velero-plugin-for-aws/volume_snapshotter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func TestSetVolumeID(t *testing.T) {
}

// missing spec.awsElasticBlockStore -> error
updatedPV, err := b.SetVolumeID(pv, "vol-updated")
_, err := b.SetVolumeID(pv, "vol-updated")
require.Error(t, err)

// happy path
Expand All @@ -149,7 +149,7 @@ func TestSetVolumeID(t *testing.T) {
"labels": labels,
}

updatedPV, err = b.SetVolumeID(pv, "vol-updated")
updatedPV, err := b.SetVolumeID(pv, "vol-updated")

require.NoError(t, err)

Expand All @@ -167,7 +167,7 @@ func TestSetVolumeIDNoZone(t *testing.T) {
}

// missing spec.awsElasticBlockStore -> error
updatedPV, err := b.SetVolumeID(pv, "vol-updated")
_, err := b.SetVolumeID(pv, "vol-updated")
require.Error(t, err)

// happy path
Expand All @@ -176,7 +176,7 @@ func TestSetVolumeIDNoZone(t *testing.T) {
"awsElasticBlockStore": aws,
}

updatedPV, err = b.SetVolumeID(pv, "vol-updated")
updatedPV, err := b.SetVolumeID(pv, "vol-updated")

require.NoError(t, err)

Expand Down

0 comments on commit cedace1

Please sign in to comment.