|
|
|
@ -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))
|
|
|
|
|