Skip to content

Commit

Permalink
Merge pull request #879 from octo/fix-conditions-usage
Browse files Browse the repository at this point in the history
Fix incorrect use of format strings with the `conditions` package.
  • Loading branch information
stefanprodan authored Jul 12, 2024
2 parents 86f2a6d + 1f4cdff commit fa93b71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/controller/receiver_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (r *ReceiverReconciler) reconcile(ctx context.Context, obj *apiv1.Receiver)

token, err := r.token(ctx, obj)
if err != nil {
conditions.MarkFalse(obj, meta.ReadyCondition, apiv1.TokenNotFoundReason, err.Error())
conditions.MarkFalse(obj, meta.ReadyCondition, apiv1.TokenNotFoundReason, "%s", err)
obj.Status.WebhookPath = ""
return ctrl.Result{Requeue: true}, err
}
Expand All @@ -171,7 +171,7 @@ func (r *ReceiverReconciler) reconcile(ctx context.Context, obj *apiv1.Receiver)
msg := fmt.Sprintf("Receiver initialized for path: %s", webhookPath)

// Mark the resource as ready and set the webhook path in status.
conditions.MarkTrue(obj, meta.ReadyCondition, meta.SucceededReason, msg)
conditions.MarkTrue(obj, meta.ReadyCondition, meta.SucceededReason, "%s", msg)

if obj.Status.WebhookPath != webhookPath {
obj.Status.WebhookPath = webhookPath
Expand Down

0 comments on commit fa93b71

Please sign in to comment.