Skip to content

Instantly share code, notes, and snippets.

@jarrpa
Created February 21, 2022 19:15
Show Gist options
  • Save jarrpa/bf7021492da07ef3037b65589d7e060f to your computer and use it in GitHub Desktop.
Save jarrpa/bf7021492da07ef3037b65589d7e060f to your computer and use it in GitHub Desktop.
diff --git a/services/provider/server/server.go b/services/provider/server/server.go
index 17a83900..a0d67bca 100644
--- a/services/provider/server/server.go
+++ b/services/provider/server/server.go
@@ -280,7 +280,11 @@ func (s *OCSProviderServer) getExternalResources(ctx context.Context, consumerRe
// Get mgr pod hostIP
podList := &corev1.PodList{}
- err = s.client.List(ctx, podList, client.MatchingLabels(map[string]string{"app": "rook-ceph-mgr"}))
+ listOpts := []client.ListOption{
+ client.InNamespace(s.namespace),
+ client.MatchingLabels(map[string]string{"app": "rook-ceph-mgr"}),
+ }
+ err = s.client.List(ctx, podList, listOpts...)
if err != nil {
return nil, fmt.Errorf("failed to list pod with rook-ceph-mgr label. %v", err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment