From 2b9f70349697df1ad58852337d80f74d5c7ea9d7 Mon Sep 17 00:00:00 2001 From: Max Goltzsche Date: Thu, 1 Sep 2022 01:57:53 +0200 Subject: [PATCH] chore: fix leaking k8s version from fn into cli test --- cmd/khelm/fn_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/khelm/fn_test.go b/cmd/khelm/fn_test.go index b29f2ff..341531e 100644 --- a/cmd/khelm/fn_test.go +++ b/cmd/khelm/fn_test.go @@ -12,6 +12,7 @@ import ( "github.com/mgoltzsche/khelm/v2/pkg/config" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "helm.sh/helm/v3/pkg/chartutil" "sigs.k8s.io/kustomize/kyaml/yaml" ) @@ -37,6 +38,11 @@ func TestKptFnCommand(t *testing.T) { }, } + origK8sVersion := chartutil.DefaultCapabilities.KubeVersion.Version + defer func() { + chartutil.DefaultCapabilities.KubeVersion.Version = origK8sVersion + }() + for _, c := range []struct { name string input kptFnConfig