Skip to content

Commit

Permalink
Add more logging for when a placement binding can't be retrieved
Browse files Browse the repository at this point in the history
Relates:
stolostron/backlog#27491

Signed-off-by: mprahl <[email protected]>
(cherry picked from commit a47d871)
  • Loading branch information
mprahl authored and openshift-cherrypick-robot committed Feb 21, 2024
1 parent d60275a commit 3679cf8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions controllers/policyset/policyset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,23 @@ func (r *PolicySetReconciler) processPolicySet(ctx context.Context, plcSet *poli

err := r.Client.Get(ctx, pbNamespacedName, pb)
if err != nil {
log.V(1).Info("Error getting placement binding " + pbName)
if errors.IsNotFound(err) {
log.V(1).Info("The placement binding was not found", "placementBinding", pbName)
} else {
log.Error(err, "Failed to get the placement binding", "placementBinding", pbName)
}

continue
}

var decisions []appsv1.PlacementDecision
decisions, err = common.GetDecisions(ctx, r.Client, pb)
if err != nil {
log.Error(err, "Error getting placement decisions for binding "+pbName)
log.Error(
err, "Failed to get placement decisions for the placement binding", "placementBinding", pbName,
)

continue
}

for _, decision := range decisions {
Expand Down

0 comments on commit 3679cf8

Please sign in to comment.