This golang code works well:
topics := &kafka.KafkaTopicList{}
d, err := clientSet.RESTClient().Get().AbsPath("/apis/kafka.strimzi.io/v1beta2/kafkatopics").DoRaw(context.TODO())
if err != nil {
panic(err.Error())
}
However I'd like to get the kafkatopics custom resources only for a given namespace, is there a way to do this using client-go api? For information, using clientSet.RESTClient().Get().Namespace("<my-namespace>") returns the following error message: "the server could not find the requested resource"
Try:
I think using CRDs,
client-go'sNamespacemethod incorrectly appendsnamespace/{namespace}into the request URL with CRDs.You want:
Using
Namespace, you get:You can prove this to yourself with: