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

new incluster swagger loading doesn;t work but depricated does #666

Open
macakmujo opened this issue Aug 19, 2020 · 2 comments
Open

new incluster swagger loading doesn;t work but depricated does #666

macakmujo opened this issue Aug 19, 2020 · 2 comments

Comments

@macakmujo
Copy link

after getting this message
kubernetes-client deprecated getInCluster see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md#request-kubeconfig- at .out/ReadOperator.js:7:48

I changed to new verion. That stopped working thios morning for no real reason so I consider it unstable
const kubeconfig = new k8s.KubeConfig();
kubeconfig.loadFromCluster();
const backend = new Request({ kubeconfig });
const client = new Client({ backend: backend /, version: "1.13"/ }); // swagger-1.13.json.gz
await client.loadSpec().catch((e: any) => console.log(e));

I am using minikube with k8 1.15.5

I switched back to depricated style and this started to work :)

const backend = new Request(Request.config.getInCluster())
const client = new Client({ backend })
await client.loadSpec()

Error that I was getting was
"Error: Failed to get /openapi/v2 and /swagger.json: forbidden: User "system:anonymous" cannot get path "/swagger.json"

I guess it did not create right context since it is depending on other external library

Thanks

@macakmujo
Copy link
Author

lol ticket 666 you should ban this number :)

@jaliph
Copy link

jaliph commented Sep 7, 2020

We are also using deprecated methods due to the same reason. It would be great if the examples are provided on how to initialize using the new constructor.

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

No branches or pull requests

2 participants