Skip to content

Commit cedace1

Browse files
authored
Merge pull request #208 from kaovilai/static-checks
static checks
2 parents 882842b + 3d55db3 commit cedace1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

velero-plugin-for-aws/volume_snapshotter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func (b *VolumeSnapshotter) DeleteSnapshot(snapshotID string) error {
242242
// see https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html
243243
var apiErr smithy.APIError
244244
if errors.As(err, &apiErr) {
245-
if "InvalidSnapshot.NotFound" == apiErr.ErrorCode() {
245+
if apiErr.ErrorCode() == "InvalidSnapshot.NotFound" {
246246
return nil
247247
}
248248
}

velero-plugin-for-aws/volume_snapshotter_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func TestSetVolumeID(t *testing.T) {
132132
}
133133

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

138138
// happy path
@@ -149,7 +149,7 @@ func TestSetVolumeID(t *testing.T) {
149149
"labels": labels,
150150
}
151151

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

154154
require.NoError(t, err)
155155

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

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

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

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

181181
require.NoError(t, err)
182182

0 commit comments

Comments
 (0)