Skip to content

Commit

Permalink
Fix Kubectl plugin to make PVC with proper capacity (#450)
Browse files Browse the repository at this point in the history
Fixes #385
  • Loading branch information
nitisht authored Feb 2, 2021
1 parent 48ccec0 commit bab8eaa
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions kubectl-minio/cmd/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,7 @@ func CapacityPerVolume(capacity string, volumes int32) (*resource.Quantity, erro
if err != nil {
return nil, err
}
totalBytes, ok := totalQuantity.AsInt64()
if !ok {
totalBytes = totalQuantity.AsDec().UnscaledBig().Int64()
}
bytesPerVolume := totalBytes / int64(volumes)
return resource.NewQuantity(bytesPerVolume, totalQuantity.Format), nil
return resource.NewQuantity(totalQuantity.Value()/int64(volumes), totalQuantity.Format), nil
}

// TotalCapacity returns total capacity of a given tenant
Expand Down

0 comments on commit bab8eaa

Please sign in to comment.