Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The clientset should not need a namespace for cluster scoped resources #237

Closed
davidovich opened this issue Mar 15, 2022 · 2 comments · Fixed by #238
Closed

The clientset should not need a namespace for cluster scoped resources #237

davidovich opened this issue Mar 15, 2022 · 2 comments · Fixed by #238

Comments

@davidovich
Copy link

davidovich commented Mar 15, 2022

The generated clientset for ClusterInputs (and other types of now (as of 1.0-rc) cluster-bound resources) needs a namespace, but since ClusterInput (et al.) is a cluster scoped resource, the Create fails.

Consider:

fluentbit, _ := fluentbitAPI.NewForConfig(config)
_, err = fluentbit.ClusterInputs("a-namespace").Create(ctx, "myInputName", metav1.CreateOptions{})
// err.Error() == "the server could not find the requested resource (post clusterinputs.fluentbit.fluent.io)"
// Causes[0]: Type: "UnexpectedServerResponse", Message: "404 page not found"

The above fails. It is equivalent to a manual call on the API:

POST /apis/fluentbit.fluent.io/v1alpha2/namespaces/a-namespace/clusterinputs

Manually calling the API at non-namespaced path (note the removed namespace):

POST /apis/fluentbit.fluent.io/v1alpha2/clusterinputs

Succeeds.

ref: API concepts.

Please advise as there doesn't seem to be any generated API to create a ClusterInput. Note that I might be "holding it wrong". The Kubebuilder options correctly state scope=Cluster, so something is strange in the generated API.

@davidovich
Copy link
Author

Thank you for the fantastic support!

@zhu733756
Copy link
Member

Thank you for the fantastic support!

No pls, let's make this repo more popular!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants