Skip to content

Commit

Permalink
Avoid code duplication for error message
Browse files Browse the repository at this point in the history
  • Loading branch information
IrvingMg committed Oct 8, 2024
1 parent 97d43a7 commit 5b2560b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/admissionchecks/provisioning/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (c *Controller) syncOwnedProvisionRequest(ctx context.Context, wl *kueue.Wo
ac.Message = fmt.Sprintf("Error creating ProvisioningRequest %q: %v", requestName, err)
workload.SetAdmissionCheckState(&wl.Status.AdmissionChecks, *ac)

c.record.Eventf(wl, corev1.EventTypeWarning, "FailedCreate", "Error creating ProvisioningRequest %q: %v", req.Name, err)
c.record.Eventf(wl, corev1.EventTypeWarning, "FailedCreate", ac.Message)
return nil, err
}
c.record.Eventf(wl, corev1.EventTypeNormal, "ProvisioningRequestCreated", "Created ProvisioningRequest: %q", req.Name)
Expand Down

0 comments on commit 5b2560b

Please sign in to comment.