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

watching custom resources with a namespace scope #468

Closed
ChrisSchreiber opened this issue May 16, 2019 · 0 comments · Fixed by #470
Closed

watching custom resources with a namespace scope #468

ChrisSchreiber opened this issue May 16, 2019 · 0 comments · Fixed by #470

Comments

@ChrisSchreiber
Copy link

ChrisSchreiber commented May 16, 2019

Using the deployment-notifier.js example works but if I change

const stream = client.apis['kubernetes-client.io'].v1.watch.deploymentnotifiers.getStream()

to

const stream = client.apis['kubernetes-client.io'].v1.namespaces('default').watch.deploymentnotifiers.getStream()

the script returns immediately without any output.

Trying to do the same thing in another project with a CRD named toolchain which has a service account with a role which only allows access to that resource I get the following response.

{
  "kind": "Status",
   "apiVersion": "v1",
   "metadata": {},
   "status": "Failure",
   "message": "watch.stable.liatr.io \"toolchains\" is forbidden: User \"system:serviceaccount:toolchain:operator-slack\" cannot get resource \"watch\" in API group \"stable.liatr.io\" in the namespace \"toolchain\"",
   "reason": "Forbidden",
   "details": {
     "name": "toolchains",
     "group": "stable.liatr.io",
     "kind": "watch"
   },
   "code": 403
 }

If I add a resource named watch to my role I do not get any response at all so my guess is that the client is sending "watch" instead of the resource name to the Kubernetes API.

iffyio added a commit to iffyio/kubernetes-client that referenced this issue May 19, 2019
Currently, URLs for namespaced watches for CRD
objects are incorrectly formatted (the result instead
tries to do a GET on a CRD named `watch`), causing k8s to
return a 404.
This patch corrects this issue

Fixes godaddy#468
silasbw pushed a commit that referenced this issue May 19, 2019
Currently, URLs for namespaced watches for CRD
objects are incorrectly formatted (the result instead
tries to do a GET on a CRD named `watch`), causing k8s to
return a 404.

This patch corrects this issue

Fixes #468
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.

1 participant