-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Volume Size Rounding Issue in PowerFlex #357
Changes from all commits
61e6ed0
28482bb
81b2f9a
86d69f0
adae212
33175f8
40d4d12
6a34c35
4c6ca70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,7 +72,7 @@ func TestGetVolSize(t *testing.T) { | |
{ | ||
// requesting a size less than 1GiB should result in a minimal size | ||
cr: &csi.CapacityRange{ | ||
RequiredBytes: 300 * bytesInKiB, | ||
RequiredBytes: 1, | ||
LimitBytes: 0, | ||
}, | ||
sizeKiB: 8 * kiBytesInGiB, | ||
|
@@ -105,6 +105,22 @@ func TestGetVolSize(t *testing.T) { | |
}, | ||
sizeKiB: 0, | ||
}, | ||
{ | ||
// Requesting a size with decimal part that rounds up to next multiple of 8 GiB | ||
cr: &csi.CapacityRange{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we add more test cases with higher decimal precision values? Additionally, let's use the same input that helped us identify this issue for consistency. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
RequiredBytes: int64(9.5 * float64(bytesInGiB)), | ||
LimitBytes: 0, | ||
}, | ||
sizeKiB: 16 * kiBytesInGiB, | ||
}, | ||
{ | ||
// Requesting a size of 8.5 GiB to test rounding up | ||
cr: &csi.CapacityRange{ | ||
RequiredBytes: int64(48.5 * float64(bytesInGiB)), | ||
LimitBytes: 0, | ||
}, | ||
sizeKiB: 56 * kiBytesInGiB, | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As these checks are focused on block storage, I am particularly interested in having similar validations for NFS as well, especially with the same input sizes. That how it behaves, I think should work but better to double check on this as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested NFS with filesystem sizes of 48.8 GiB and 3.001 GiB (3073 MiB). In both cases, the filesystems were successfully created. The only requirement for filesystem creation is that the size must not be less than 3 GiB, which is handled in the code.