Skip to content

Commit

Permalink
Merge pull request #28 from civo/fix/refactor-code
Browse files Browse the repository at this point in the history
Add proper error handling and remove unnecessary variable definition
  • Loading branch information
hlts2 authored Nov 11, 2024
2 parents b7261a3 + e9e049b commit d37fbd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions e2e/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func TestMain(m *testing.M) {
}

controller.Spec.Template.Spec.Containers[3].Image = Image
e2eTest.tenantClient.Update(context.TODO(), controller)
err = e2eTest.tenantClient.Update(context.TODO(), controller)
if err != nil {
log.Panic(err)
}
Expand All @@ -120,7 +120,7 @@ func TestMain(m *testing.M) {
log.Panic(err)
}

e2eTest.tenantClient.Update(context.TODO(), csiDS)
err = e2eTest.tenantClient.Update(context.TODO(), csiDS)
if err != nil {
log.Panic(err)
}
Expand Down
4 changes: 1 addition & 3 deletions pkg/driver/controller_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,14 +600,12 @@ func (d *Driver) ListSnapshots(context.Context, *csi.ListSnapshotsRequest) (*csi
}

func getVolSizeInBytes(capRange *csi.CapacityRange) (int64, error) {
var bytes int64

if capRange == nil {
return int64(DefaultVolumeSizeGB) * BytesInGigabyte, nil
}

// Volumes can be of a flexible size, but they must specify one of the fields, so we'll use that
bytes = capRange.GetRequiredBytes()
bytes := capRange.GetRequiredBytes()
if bytes == 0 {
bytes = capRange.GetLimitBytes()
}
Expand Down

0 comments on commit d37fbd7

Please sign in to comment.