Merge pull request #6818 from thomastaylor312/fix/v1_apiextensions

fix(chartutil): Add the v1 apiextensions to the default scheme
pull/6821/head
Taylor Thomas 5 years ago committed by GitHub
commit 2f4ef705a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -18,6 +18,7 @@ package chartutil
import (
"k8s.io/client-go/kubernetes/scheme"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
)
@ -75,9 +76,11 @@ func (v VersionSet) Has(apiVersion string) bool {
}
func allKnownVersions() VersionSet {
// Otherwise `helm template` fails validating due to an error like the below:
// Error: apiVersion "apiextensions.k8s.io/v1beta1" in mychart/templates/crd.yaml is not available
// We should register the built in extension APIs as well so CRDs are
// supported in the default version set. This has caused problems with `helm
// template` in the past, so let's be safe
apiextensionsv1beta1.AddToScheme(scheme.Scheme)
apiextensionsv1.AddToScheme(scheme.Scheme)
groups := scheme.Scheme.PrioritizedVersionsAllGroups()
vs := make(VersionSet, 0, len(groups))

Loading…
Cancel
Save