-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Apply failed: Unexpected unknown resource type: class io.kubernetes.client.openapi.models.V1beta1PodSecurityPolicy #2251
Comments
Quick note: You say your Kubernetes version is 1.2.1 which is ancient I'm going to assume it's actually 1.21.x, but if it really is 1.2.1 that is way too old for this client to work correctly. Assuming it is 1.21.x: You can manually initialize discovery via the call here: |
Thanks @brendandburns, you are correct it is 1.21, I mistyped. The first link you added is the issue number for this, I am assuming it was meant to go to another issue? |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi, I commented this on another issue but thought I would create a new issue in case it is a part of a larger issue.
I am attempting to apply the calico-operator yaml using the 'kubernetes java client' and it is resulting in a similar exception being thrown.
"io.kubernetes.client.extended.kubectl.exception.KubectlException: Unexpected unknown resource type: class io.kubernetes.client.openapi.models.V1beta1PodSecurityPolicy"
I have done some testing and have narrowed the exception down to coming from line 4862 in the calico-operator.yaml for that PodSecurityPolicy.
When I apply it through the command line with "kubectl apply -f <file.yaml>" it has no problem applying and throws no exception, but when applying it with the Kubernetes Java client I get that exception. Unfortunately, I cannot rely on using scripts to apply it through the command line and therefore need the java client working.
Are there any thoughts as to why this is happening, and what can be done to fix it?
I have attached the yaml I am trying to apply. You can also find it here:
https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/master/config/master/calico-operator.yaml
calico-operator.yaml.txt
Kubernetes Java Client Version
14.0.1
Kubernetes Java Client Extended Version
15.0.1
Kubernetes Version
1.2.1
AWS Java SDK
2.17.46
Java Version
Java 8
The text was updated successfully, but these errors were encountered: