Closed josephpeacock closed 3 years ago
This is false. I was using the wrong syntax - for anyone in the future having similar issues to me, here's how to do it right:
kubeClient.MCSApis().MulticlusterV1alpha1().ServiceExports("nsName").Get(context.TODO(), "serviceExportName", metav1.GetOptions{})
Current Behavior: The serviceexport client has ns as a private field in the struct (https://github.com/kubernetes-sigs/mcs-api/blob/master/pkg/client/clientset/versioned/typed/apis/v1alpha1/serviceexport.go#L55), and uses that as a hardcoded namespace value in all operations. This makes it difficult to use the client for an entire cluster, to create ServiceExport resources for Services in arbitrary namespaces.
Expected Behavior: I can create a single client, and provide the namespace at call-time to specify CRUD operations to occur in/for a specific namespace
As a workaround, I have been directly using the RESTClient, for example:
But that is unwieldy in the code, and makes unit testing more difficult.