From cede8499500ddf2d608954f4f82cc2208b124919 Mon Sep 17 00:00:00 2001 From: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> Date: Wed, 14 Feb 2024 09:20:15 -0500 Subject: [PATCH] Update PlacementBinding messages to use ns/name Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> (cherry picked from commit 78839d217eb2168d9d02587638b3cfb70890d95c) --- controllers/common/common.go | 4 ++-- controllers/common/common_status_update.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/common/common.go b/controllers/common/common.go index c52bd6f7..059fe273 100644 --- a/controllers/common/common.go +++ b/controllers/common/common.go @@ -180,7 +180,7 @@ func GetDecisions( ctx context.Context, c client.Client, pb *policiesv1.PlacementBinding, ) ([]appsv1.PlacementDecision, error) { if !HasValidPlacementRef(pb) { - return nil, fmt.Errorf("placement binding %s/%s reference is not valid", pb.Name, pb.Namespace) + return nil, fmt.Errorf("placement binding %s/%s reference is not valid", pb.Namespace, pb.Name) } refNN := types.NamespacedName{ @@ -234,7 +234,7 @@ func GetDecisions( return plr.Status.Decisions, nil } - return nil, fmt.Errorf("placement binding %s/%s reference is not valid", pb.Name, pb.Namespace) + return nil, fmt.Errorf("placement binding %s/%s reference is not valid", pb.Namespace, pb.Name) } func ParseRootPolicyLabel(rootPlc string) (name, namespace string, err error) { diff --git a/controllers/common/common_status_update.go b/controllers/common/common_status_update.go index ac197688..5247ea70 100644 --- a/controllers/common/common_status_update.go +++ b/controllers/common/common_status_update.go @@ -70,7 +70,7 @@ func GetPolicyPlacementDecisions(ctx context.Context, c client.Client, instance *policiesv1.Policy, pb *policiesv1.PlacementBinding, ) (decisions []appsv1.PlacementDecision, placements []*policiesv1.Placement, err error) { if !HasValidPlacementRef(pb) { - return nil, nil, fmt.Errorf("placement binding %s/%s reference is not valid", pb.Name, pb.Namespace) + return nil, nil, fmt.Errorf("placement binding %s/%s reference is not valid", pb.Namespace, pb.Name) } policySubjectFound := false