open-horizon / anax

Horizon agent control system
https://open-horizon.github.io/docs/anax/docs/
Apache License 2.0
72 stars 98 forks source link

Minor bug in combineRoleBindingSubjects function #3951

Open sector-f opened 9 months ago

sector-f commented 9 months ago

95757258ef931d3540d93c9cb3de17061622d9f5 added the combineRoleBindingSubjects function. I believe there is a bug in this line of the function.

sub.Kind is used in the key string twice, but the comment makes it sound like one of those should probably be sub.Name:

-       key := fmt.Sprintf("%v/%v/%v", sub.Namespace, sub.Kind, sub.Kind) // key is <namespace>/<kind>/<name>
+       key := fmt.Sprintf("%v/%v/%v", sub.Namespace, sub.Kind, sub.Name) // key is <namespace>/<kind>/<name>
sector-f commented 9 months ago

@MaxMcAdam