Skip to content

Commit

Permalink
Propagate PVC creation error
Browse files Browse the repository at this point in the history
When having an error creating a PVC, the real cause wasn't shown in the
logs. Now the reason will appear both on the plan status and in the
controller logs.

Signed-off-by: Liran Rotenberg <[email protected]>
  • Loading branch information
liranr23 authored and ahadas committed Mar 3, 2024
1 parent f9adc46 commit c7ba2c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/plan/adapter/ovirt/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ func (r *Builder) PopulatorVolumes(vmRef ref.Ref, annotations map[string]string,
pvc, err = r.persistentVolumeClaimWithSourceRef(diskAttachment, storageClassName, populatorName, annotations)
if err != nil {
if !k8serr.IsAlreadyExists(err) {
err = liberr.New("couldn't build the PVC", "diskAttachmentID", diskAttachment.DiskAttachment.ID,
err = liberr.Wrap(err, "couldn't build the PVC", "diskAttachmentID", diskAttachment.DiskAttachment.ID,
"storageClassName", storageClassName, "populatorName", populatorName)
return
}
Expand Down

0 comments on commit c7ba2c5

Please sign in to comment.