From b6f5762d46a38641f05354e8ebc502b57790ffe1 Mon Sep 17 00:00:00 2001 From: Taylor Thomas Date: Tue, 29 Oct 2019 12:10:58 -0600 Subject: [PATCH] fix(chartutil): Add the v1 apiextensions to the default scheme Signed-off-by: Taylor Thomas --- pkg/chartutil/capabilities.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/chartutil/capabilities.go b/pkg/chartutil/capabilities.go index 97e4cc945..f46350bb1 100644 --- a/pkg/chartutil/capabilities.go +++ b/pkg/chartutil/capabilities.go @@ -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))