Skip to content

Commit

Permalink
fix #648: use fmt.Errorf
Browse files Browse the repository at this point in the history
  • Loading branch information
srteam2020 committed Apr 7, 2021
1 parent 9aff91f commit 3d48973
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ func (r *RabbitmqClusterReconciler) statefulSetUID(ctx context.Context, rmq *rab
return "", fmt.Errorf("failed to get statefulSet: %s", err.Error())
}
if ref = metav1.GetControllerOf(sts); ref == nil {
return "", errors.New("failed to get controller reference for statefulSet")
return "", fmt.Errorf("failed to get controller reference for statefulSet %s", sts.GetName())
}
if string(rmq.GetUID()) != string(ref.UID) {
return "", errors.New("statefulSet not owner by current RabbitmqCluster")
return "", fmt.Errorf("statefulSet %s not owned by current RabbitmqCluster %s", sts.GetName(), rmq.GetName())
}
return sts.UID, nil
}
Expand Down

0 comments on commit 3d48973

Please sign in to comment.