Skip to content

Commit

Permalink
Fix disk conversion casing
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Lim committed May 14, 2024
1 parent 67111a1 commit 7c23d1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/disk/disk_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ func (r *diskResource) Delete(ctx context.Context, req resource.DeleteRequest, r
}

func formatSize(sizeStr string) string {
sizeStr = strings.ToLower(sizeStr)
if strings.HasSuffix(sizeStr, "gib") {
lowerSize := strings.ToLower(sizeStr)
if strings.HasSuffix(lowerSize, "gib") {
if size, err := strconv.Atoi(sizeStr[:len(sizeStr)-3]); err != nil &&
size >= gibInTib && size%gibInTib == 0 {

Expand Down

0 comments on commit 7c23d1c

Please sign in to comment.