Skip to content

Commit

Permalink
chore: fix leaking k8s version from fn into cli test
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoltzsche committed Sep 1, 2022
1 parent 47ca132 commit 2b9f703
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/khelm/fn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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
Expand Down

0 comments on commit 2b9f703

Please sign in to comment.