Skip to content

Commit

Permalink
Update PlacementBinding messages to use ns/name
Browse files Browse the repository at this point in the history
Signed-off-by: Dale Haiducek <[email protected]>
(cherry picked from commit 78839d2)
  • Loading branch information
dhaiducek committed Feb 15, 2024
1 parent 6d25754 commit cede849
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions controllers/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion controllers/common/common_status_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cede849

Please sign in to comment.