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

Unable to create a Template on OCP3 #2373

Closed
mchoma opened this issue Jul 28, 2020 · 2 comments · Fixed by #2375 or #2490
Closed

Unable to create a Template on OCP3 #2373

mchoma opened this issue Jul 28, 2020 · 2 comments · Fixed by #2375 or #2490
Assignees

Comments

@mchoma
Copy link

mchoma commented Jul 28, 2020

This is clone of xtf-cz/xtf#373 because I believe kubernetes client should keep backward compatibility.

I am getting

io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https://api.multinode-nfs-022.dynamic.xpaas:8443/apis/template.openshift.io/v1/namespaces/istraka-namespace-2/templates. Message: the API version in the data (v1) does not match the expected API version (template.openshift.io/v1). Received status: Status(apiVersion=v1, code=400, details=null, kind=Status, message=the API version in the data (v1) does not match the expected API version (template.openshift.io/v1), metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=BadRequest, status=Failure, additionalProperties={}).

With 4.9.2 it was OK.

After some debugging, the difference is in URL:
4.9.2:

https://api.multinode-nfs-022.dynamic.xpaas:8443/oapi/v1/namespaces/istraka-namespace/templates

4.10.2

https://api.multinode-nfs-022.dynamic.xpaas:8443/apis/template.openshift.io/v1/namespaces/istraka-namespace-2/templates

Workaround:

template.setApiVersion("template.openshift.io/v1");
@mchoma
Copy link
Author

mchoma commented Jul 28, 2020

@rohanKanojia @gastaldi Can you have a look please? We have talk about something similar in #1805

@rohanKanojia
Copy link
Member

let me revisit this whenever I get time today.

@rohanKanojia rohanKanojia self-assigned this Jul 28, 2020
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Jul 28, 2020
Looks like code added in fabric8io#1956 BackwardCompatibilityInterceptor wasn't handling
/oapi failures properly.

Fix BackwardCompatibilityInterceptor logic for routing to OpenShift 3 /oapi/v1
endpoints when OpenShift 4 /apis/{group}/v1 endpoints not found. Also added some
tests to assert desired behavior
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Jul 28, 2020
Looks like code added in fabric8io#1956 BackwardCompatibilityInterceptor wasn't handling
/oapi failures properly.

Fix BackwardCompatibilityInterceptor logic for routing to OpenShift 3 /oapi/v1
endpoints when OpenShift 4 /apis/{group}/v1 endpoints not found. Also added some
tests to assert desired behavior
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Jul 31, 2020
Looks like code added in fabric8io#1956 BackwardCompatibilityInterceptor wasn't handling
/oapi failures properly.

Fix BackwardCompatibilityInterceptor logic for routing to OpenShift 3 /oapi/v1
endpoints when OpenShift 4 /apis/{group}/v1 endpoints not found. Also added some
tests to assert desired behavior
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Sep 15, 2020
…to /oapi URLs

This commit reverts 293ab9d which was added in order
to fix fabric8io#2373. This behavior was causing problems with Strimzi's Kubernetes Client
upgrade: strimzi/strimzi-kafka-operator#3553 . On bisecting
the failing test, I found this commit as culprit. Handling OpenShift old /oapi
requests seem to be handled in OpenShiftOperation where we check `config.isOpenshiftApiGroupsEnabled()`
to modify OperationContext.

However, fabric8io#2373 can be fixed by adding apiVersion in OpenShiftOperation.
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Sep 16, 2020
…to /oapi URLs

This commit reverts 293ab9d which was added in order
to fix fabric8io#2373. This behavior was causing problems with Strimzi's Kubernetes Client
upgrade: strimzi/strimzi-kafka-operator#3553 . On bisecting
the failing test, I found this commit as culprit. Handling OpenShift old /oapi
requests seem to be handled in OpenShiftOperation where we check `config.isOpenshiftApiGroupsEnabled()`
to modify OperationContext.

However, fabric8io#2373 can be fixed by adding apiVersion in OpenShiftOperation.
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Sep 21, 2020
…to /oapi URLs

This commit reverts 293ab9d which was added in order
to fix fabric8io#2373. This behavior was causing problems with Strimzi's Kubernetes Client
upgrade: strimzi/strimzi-kafka-operator#3553 . On bisecting
the failing test, I found this commit as culprit. Handling OpenShift old /oapi
requests seem to be handled in OpenShiftOperation where we check `config.isOpenshiftApiGroupsEnabled()`
to modify OperationContext.

However, fabric8io#2373 can be fixed by adding apiVersion in OpenShiftOperation.
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Sep 21, 2020
…to /oapi URLs

This commit reverts 293ab9d which was added in order
to fix fabric8io#2373. This behavior was causing problems with Strimzi's Kubernetes Client
upgrade: strimzi/strimzi-kafka-operator#3553 . On bisecting
the failing test, I found this commit as culprit. Handling OpenShift old /oapi
requests seem to be handled in OpenShiftOperation where we check `config.isOpenshiftApiGroupsEnabled()`
to modify OperationContext.

However, fabric8io#2373 can be fixed by adding apiVersion in OpenShiftOperation.
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Sep 21, 2020
…to /oapi URLs

This commit reverts 293ab9d which was added in order
to fix fabric8io#2373. This behavior was causing problems with Strimzi's Kubernetes Client
upgrade: strimzi/strimzi-kafka-operator#3553 . On bisecting
the failing test, I found this commit as culprit. Handling OpenShift old /oapi
requests seem to be handled in OpenShiftOperation where we check `config.isOpenshiftApiGroupsEnabled()`
to modify OperationContext.

However, fabric8io#2373 can be fixed by adding apiVersion in OpenShiftOperation.
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Sep 21, 2020
…to /oapi URLs

This commit reverts 293ab9d which was added in order
to fix fabric8io#2373. This behavior was causing problems with Strimzi's Kubernetes Client
upgrade: strimzi/strimzi-kafka-operator#3553 . On bisecting
the failing test, I found this commit as culprit. Handling OpenShift old /oapi
requests seem to be handled in OpenShiftOperation where we check `config.isOpenshiftApiGroupsEnabled()`
to modify OperationContext.

However, fabric8io#2373 can be fixed by adding apiVersion in OpenShiftOperation.
vsalbaba pushed a commit to vsalbaba/xtf that referenced this issue Jun 17, 2021
vsalbaba pushed a commit to vsalbaba/xtf that referenced this issue Jun 22, 2021
mnovak1 pushed a commit to xtf-cz/xtf that referenced this issue Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants