Skip to content

Commit

Permalink
Fixup resize routine (#390)
Browse files Browse the repository at this point in the history
Signed-off-by: Max Shaposhnyk <[email protected]>
  • Loading branch information
mshaposhnik authored Jan 15, 2025
1 parent b77ee35 commit 85c5fe6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/ibm/ibmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ func (r IBMPowerDynamicConfig) resizeInstanceVolume(ctx context.Context, service
continue
}

log.Info("Current volume size: %d", *instance.DiskSize, "instance", *id)
if *instance.DiskSize == r.Disk {
//nothing to do
return
Expand All @@ -423,11 +424,12 @@ func (r IBMPowerDynamicConfig) resizeInstanceVolume(ctx context.Context, service
log.Info("Resizing instance volume", "instance", *id, "volumeID", instance.VolumeIDs[0], "size", r.Disk)
err = r.updateVolume(localCtx, service, instance.VolumeIDs[0])
if err != nil {
log.Error(err, "failed to resize power server volume")
if err.Error() != "conflict" { // conflicts may happen if volume is not ready yet
return
if err.Error() == "conflict" { // conflicts may happen if volume is not ready yet
continue
}
log.Error(err, "failed to resize power server volume")
}
return
}
}()
}
Expand Down

0 comments on commit 85c5fe6

Please sign in to comment.