Skip to content

Commit

Permalink
IBM-p configurable disk size final refinements
Browse files Browse the repository at this point in the history
Signed-off-by: Max Shaposhnyk <mshaposh@redhat.com>
  • Loading branch information
mshaposhnik committed Jan 13, 2025
1 parent c35189c commit 6a9777a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkg/ibm/ibmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,12 @@ func (r IBMPowerDynamicConfig) resizeInstanceVolume(ctx context.Context, service
if len(instance.VolumeIDs) == 0 {
continue
}

if *instance.DiskSize == r.Disk {
//nothing to do
return
}

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 {
Expand Down Expand Up @@ -458,12 +464,12 @@ func (r IBMPowerDynamicConfig) updateVolume(ctx context.Context, service *core.B
return err
}

var rawResponse []map[string]json.RawMessage
_, err = service.Request(request, &rawResponse)
//println(response.String())
var vRef models.VolumeReference
_, err = service.Request(request, &vRef)
if err != nil {
log.Error(err, "failed to update pvm volume")
return err
}
log.Info("Volume size updated", "volumeId", vRef.VolumeID, "size", vRef.Size)
return nil
}

0 comments on commit 6a9777a

Please sign in to comment.