Skip to content

Commit

Permalink
ClusterToObjectsMapper: use namespace in client.List
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Büringer buringerst@vmware.com
  • Loading branch information
sbueringer committed Oct 5, 2021
1 parent 6ab9c28 commit 22b4a6d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion util/util.go
Expand Up @@ -501,7 +501,14 @@ func ClusterToObjectsMapper(c client.Client, ro runtime.Object, scheme *runtime.

list := &unstructured.UnstructuredList{}
list.SetGroupVersionKind(gvk)
if err := c.List(context.TODO(), list, client.MatchingLabels{clusterv1.ClusterLabelName: cluster.Name}); err != nil {
if err := c.List(
context.TODO(),
list,
client.InNamespace(cluster.Namespace),
client.MatchingLabels{
clusterv1.ClusterLabelName: cluster.Name,
},
); err != nil {
return nil
}

Expand Down

0 comments on commit 22b4a6d

Please sign in to comment.