Description of problem: When trying to process a template (eg: https://raw.githubusercontent.com/Maistra/openshift-ansible/maistra-0.7/istio/istio_community_operator_template.yaml ) I receive the error in the subject: error: no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1beta1" in scheme "k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28" Version-Release number of selected component (if applicable): oc v4.0.0-0.79.0 kubernetes v1.11.0+d4cacc0 features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://beta-10-190131-2-api.ocp4testing.openshiftdemos.com:6443 kubernetes v1.11.0+c69f926354 How reproducible: 100% Steps to Reproduce: 1. oc new-app https://raw.githubusercontent.com/Maistra/openshift-ansible/maistra-0.7/istio/istio_community_operator_template.yaml Actual results: error: no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1beta1" in scheme "k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28" Expected results: Successful creation of template resources Additional info: Older oc against the same cluster works: oc v3.11.16 kubernetes v1.11.0+d4cacc0 features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://beta-10-190131-2-api.ocp4testing.openshiftdemos.com:6443 kubernetes v1.11.0+c69f926354
Fix in https://github.com/openshift/origin/pull/21936
Devexp team should re-write new-app, I've created https://jira.coreos.com/browse/DEVEXP-285 to track it.
*** Bug 1662865 has been marked as a duplicate of this bug. ***
This is still not fixed with v4.0.22
@Erik did you update your oc client?
oc new-app -n istio-operator -f https://raw.githubusercontent.com/Maistra/openshift-ansible/maistra-0.7/istio/istio_community_operator_template.yaml -p OPENSHIFT_ISTIO_MASTER_PUBLIC_URL=https://api.beta-190318-1.ocp4testing.openshiftdemos.com:6443 error: no kind \"CustomResourceDefinition\" is registered for version \"apiextensions.k8s.io/v1beta1\" in scheme \"k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28\ oc version Client Version: version.Info{Major:"4", Minor:"0+", GitVersion:"v4.0.22", GitCommit:"d14915559e", GitTreeState:"", BuildDate:"2019-03-14T21:55:38Z", GoVersion:"", Compiler:"", Platform:""} Server Version: version.Info{Major:"1", Minor:"12+", GitVersion:"v1.12.4+0f8e04e", GitCommit:"0f8e04e", GitTreeState:"clean", BuildDate:"2019-03-04T15:33:19Z", GoVersion:"go1.10.8", Compiler:"gc", Platform:"linux/amd64"} There is no newer build available on the mirror site.
`oc process` does support templates which create CRDs and custom resources. Work-around is to pipe `oc process` output to `oc create` [1]. oc new-app should capture this error and inform developers of this work-around. [1] https://docs.openshift.com/container-platform/3.11/dev_guide/templates.html#generating-a-list-of-objects
Moving this to low-severity - this should not block 4.1 GA release.
PR https://github.com/openshift/origin/pull/22518 is up against master branch Assuming we'll cherry pick back to 3.11.x
@Gabe If we're going to backport to 3.11, I'd clone this BZ so errata can be generated through the normal process.
Actually @Adam I'm instead going to employ - have QA verify with a 4.x build that contains the merged commit from https://github.com/openshift/origin/pull/22518 - when they mark it verified, move the bug back to POST and cherrypick into 3.11 - when that PR merges, we'll move through the MODIFIED/doc for Errata/verify on 3.11 cycle.
A little defect need be improved. When 'oc new-app -f' with file, the promption is "oc process -f file | oc create -f -". But if without -f in 'oc new-app', the promption is 'oc process | oc create', it's not clear in next step for customer. $oc new-app -f ~/workdir/xiuwang/cmbuild/template-with-crd.yaml error: The template contained an object type unknown to `oc new-app`. Use `oc process -f /home/wxj/workdir/xiuwang/cmbuild/template-with-crd.yaml | oc create -f -` instead. Error details: no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1beta1" in scheme "k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28" $oc new-app https://raw.githubusercontent.com/Maistra/openshift-ansible/maistra-0.7/istio/istio_community_operator_template.yaml error: The template contained an object type unknown to `oc new-app`. Use `oc process | oc create` instead. Error details: no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1beta1" in scheme "k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28" $oc version Client Version: version.Info{Major:"4", Minor:"1+", GitVersion:"v4.1.0", GitCommit:"85db872d8", GitTreeState:"", BuildDate:"2019-04-17T20:07:02Z", GoVersion:"", Compiler:"", Platform:""} Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.4+53af542", GitCommit:"53af542", GitTreeState:"clean", BuildDate:"2019-04-16T06:50:32Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
PR https://github.com/openshift/origin/pull/22604 is up to address @XiuJuan's suggestion plus something @Adam realized
FYI @XiuJuan during PR review it has been decided to go with a generic format of: oc process -f <template> | oc create -f - we won't try to place the actual supplied parameters.
OK PR https://github.com/openshift/origin/pull/22604 has merged. See #Comment 19 on where we landed with the message. If QE verifies in 4.x I'll move on to crafting the 3.11 change with this bug.
The fix works with oc client getting from payload 4.1.0-0.ci-2019-04-24-043324 $ oc new-app -f template-with-crd.yaml error: The template contained an object type unknown to `oc new-app`. Use `oc process -f <template> | oc create -f -` instead. Error details: no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1beta1" in scheme "k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28" $ oc new-app https://raw.githubusercontent.com/Maistra/openshift-ansible/maistra-0.7/istio/istio_community_operator_template.yaml error: The template contained an object type unknown to `oc new-app`. Use `oc process -f <template> | oc create -f -` instead. Error details: no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1beta1" in scheme "k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28" $ oc version --short Client Version: v4.0.0-alpha.0+2cbb022-2151-dirty Server Version: v1.13.4+c3edcc6
great thanks @XiuJuan and eschewing the re-purpose this bug for 3.11 with Adam's clone the bug
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:0758