mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #66324 from krunaljain/bugfix/revert_pd_size_rounding_to_GB
Automatic merge from submit-queue (batch tested with PRs 66175, 66324, 65828, 65901, 66350). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
Fixing E2E tests for disk resizing
What this PR does / why we need it:
This PR fixed the E2E test failure due to [this](539b3693f4
) commit. The case of disk resizing was not handled which is fixed in this commit.
Issues Fixed:
[#66295
](https://github.com/kubernetes/kubernetes/issues/66295)
```release-note
none
```
This commit is contained in:
commit
041ba05514
@ -748,11 +748,11 @@ func (gce *GCECloud) ResizeDisk(diskToResize string, oldSize resource.Quantity,
|
||||
|
||||
requestBytes := newSize.Value()
|
||||
// GCE resizes in chunks of GiBs
|
||||
requestGB := volumeutil.RoundUpSize(requestBytes, volumeutil.GIB)
|
||||
newSizeQuant := resource.MustParse(fmt.Sprintf("%dG", requestGB))
|
||||
requestGIB := volumeutil.RoundUpSize(requestBytes, volumeutil.GIB)
|
||||
newSizeQuant := resource.MustParse(fmt.Sprintf("%dGi", requestGIB))
|
||||
|
||||
// If disk is already of size equal or greater than requested size, we simply return
|
||||
if disk.SizeGb >= requestGB {
|
||||
if disk.SizeGb >= requestGIB {
|
||||
return newSizeQuant, nil
|
||||
}
|
||||
|
||||
@ -761,7 +761,7 @@ func (gce *GCECloud) ResizeDisk(diskToResize string, oldSize resource.Quantity,
|
||||
switch zoneInfo := disk.ZoneInfo.(type) {
|
||||
case singleZone:
|
||||
mc = newDiskMetricContextZonal("resize", disk.Region, zoneInfo.zone)
|
||||
err := gce.manager.ResizeDiskOnCloudProvider(disk, requestGB, zoneInfo.zone)
|
||||
err := gce.manager.ResizeDiskOnCloudProvider(disk, requestGIB, zoneInfo.zone)
|
||||
|
||||
if err != nil {
|
||||
return oldSize, mc.Observe(err)
|
||||
@ -774,7 +774,7 @@ func (gce *GCECloud) ResizeDisk(diskToResize string, oldSize resource.Quantity,
|
||||
}
|
||||
|
||||
mc = newDiskMetricContextRegional("resize", disk.Region)
|
||||
err := gce.manager.RegionalResizeDiskOnCloudProvider(disk, requestGB)
|
||||
err := gce.manager.RegionalResizeDiskOnCloudProvider(disk, requestGIB)
|
||||
|
||||
if err != nil {
|
||||
return oldSize, mc.Observe(err)
|
||||
|
Loading…
Reference in New Issue
Block a user