Merge pull request #7245 from waveywaves/fix/crd-install-api-extensions

fix(kube/client) crd install with apiextensions.k8s.io/v1
pull/7364/head
Matthew Fisher 5 years ago committed by GitHub
commit 9e4d42e18c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -30,6 +30,7 @@ import (
"github.com/pkg/errors"
batch "k8s.io/api/batch/v1"
v1 "k8s.io/api/core/v1"
apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
apiextv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
@ -62,6 +63,10 @@ func New(getter genericclioptions.RESTClientGetter) *Client {
getter = genericclioptions.NewConfigFlags(true)
}
// Add CRDs to the scheme. They are missing by default.
if err := apiextv1.AddToScheme(scheme.Scheme); err != nil {
// This should never happen.
panic(err)
}
if err := apiextv1beta1.AddToScheme(scheme.Scheme); err != nil {
// This should never happen.
panic(err)

Loading…
Cancel
Save