diff --git a/internal/utils/utils_test.go b/internal/utils/utils_test.go index 02c06f5cb9..9276b2c748 100644 --- a/internal/utils/utils_test.go +++ b/internal/utils/utils_test.go @@ -208,11 +208,13 @@ func TestBuildImagePath(t *testing.T) { func TestIsInHelmMode(t *testing.T) { orig := os.Getenv(CLIModeVariableName) + defer func() { + assert.NoError(t, os.Setenv(CLIModeVariableName, orig)) + }() assert.NoError(t, os.Setenv(CLIModeVariableName, "helm")) assert.True(t, IsInHelmMode()) assert.NoError(t, os.Setenv(CLIModeVariableName, "classic")) assert.False(t, IsInHelmMode()) assert.NoError(t, os.Setenv(CLIModeVariableName, "random")) assert.False(t, IsInHelmMode()) - assert.NoError(t, os.Setenv(CLIModeVariableName, orig)) }