-
Notifications
You must be signed in to change notification settings - Fork 42
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
PV Resizing: Give precedance to usage percentage #1112
Changes from all commits
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 |
---|---|---|
|
@@ -261,7 +261,7 @@ func TestPersistentVolumeAdjuster_calculateProposedVolumeSize(t *testing.T) { | |
wantReason string | ||
}{ | ||
{ | ||
name: "Given values of usagePercentage, actualCapacity and requestedCapacity, appropriate volume size is returned, here proposed size = actual capacity", | ||
name: "Given requested capacity < actual capacity, should return 103% of used capacity of the volume", | ||
fields: fields{ | ||
Client: fake.NewFakeClient(), | ||
}, | ||
|
@@ -270,11 +270,11 @@ func TestPersistentVolumeAdjuster_calculateProposedVolumeSize(t *testing.T) { | |
actualCapacity: resource.MustParse("200"), | ||
requestedCapacity: resource.MustParse("20"), | ||
}, | ||
wantProposedSize: resource.MustParse("200"), | ||
wantProposedSize: resource.MustParse("106"), | ||
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. I see that 103% is desired but 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. Yes, a typo and a logic flaw :) Good catch 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. Ohh now that I realized, this is not a logic issue. 106 is the correct value, the reference for usage percentage is the actual volume size which is 200 in this case, which makes the 3% = 6Gi buffer. We cannot use requested size as a reference point as it could differ from actual capacity. |
||
wantReason: migapi.VolumeAdjustmentCapacityMismatch, | ||
}, | ||
{ | ||
name: "Given values of usagePercentage, actualCapacity and requestedCapacity, appropriate proposed volume size is returned, here proposed size = volume with threshold size", | ||
name: "Given volume usage close to 100%, should return 103% of original capacity", | ||
fields: fields{ | ||
Client: fake.NewFakeClient(), | ||
}, | ||
|
@@ -287,7 +287,7 @@ func TestPersistentVolumeAdjuster_calculateProposedVolumeSize(t *testing.T) { | |
wantReason: migapi.VolumeAdjustmentUsageExceeded, | ||
}, | ||
{ | ||
name: "Given values of usagePercentage, actualCapacity and requestedCapacity, appropriate proposed volume size is returned, here proposed size = requested capacity", | ||
name: "Given requested capacity > actual capacity, should return requested capacity", | ||
fields: fields{ | ||
Client: fake.NewFakeClient(), | ||
}, | ||
|
@@ -300,8 +300,7 @@ func TestPersistentVolumeAdjuster_calculateProposedVolumeSize(t *testing.T) { | |
wantReason: migapi.VolumeAdjustmentNoOp, | ||
}, | ||
{ | ||
name: "Given values of usagePercentage, actualCapacity and requestedCapacity, appropriate volume size is returned, here volumeS size with threshold" + | ||
"is greater than requested capacity and actual capacity is greater than requested capacity", | ||
name: "Given requested capacity < actual capacity and usage not close to 100%, should return requested capacity", | ||
fields: fields{ | ||
Client: fake.NewFakeClient(), | ||
}, | ||
|
@@ -310,7 +309,7 @@ func TestPersistentVolumeAdjuster_calculateProposedVolumeSize(t *testing.T) { | |
actualCapacity: resource.MustParse("200"), | ||
requestedCapacity: resource.MustParse("150"), | ||
}, | ||
wantProposedSize: resource.MustParse("200"), | ||
wantProposedSize: resource.MustParse("150"), | ||
wantReason: migapi.VolumeAdjustmentCapacityMismatch, | ||
}, | ||
} | ||
|
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.
Question: do we let users know that we are planning to downsize their volumes from the provisioned capacity?
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.
@djwhatle Good point. No we do not.