|
|
@ -20,6 +20,9 @@ import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"testing"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"helm.sh/helm/v4/pkg/action"
|
|
|
|
chart "helm.sh/helm/v4/pkg/chart/v2"
|
|
|
|
chart "helm.sh/helm/v4/pkg/chart/v2"
|
|
|
|
"helm.sh/helm/v4/pkg/release"
|
|
|
|
"helm.sh/helm/v4/pkg/release"
|
|
|
|
helmtime "helm.sh/helm/v4/pkg/time"
|
|
|
|
helmtime "helm.sh/helm/v4/pkg/time"
|
|
|
@ -93,3 +96,24 @@ func outputFlagCompletionTest(t *testing.T, cmdName string) {
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
runTestCmd(t, tests)
|
|
|
|
runTestCmd(t, tests)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func TestPostRendererFlagSetOnce(t *testing.T) {
|
|
|
|
|
|
|
|
cfg := action.Configuration{}
|
|
|
|
|
|
|
|
client := action.NewInstall(&cfg)
|
|
|
|
|
|
|
|
str := postRendererString{
|
|
|
|
|
|
|
|
options: &postRendererOptions{
|
|
|
|
|
|
|
|
renderer: &client.PostRenderer,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Set the binary once
|
|
|
|
|
|
|
|
err := str.Set("echo")
|
|
|
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set the binary again to the same value is not ok
|
|
|
|
|
|
|
|
err = str.Set("echo")
|
|
|
|
|
|
|
|
require.Error(t, err)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set the binary again to a different value is not ok
|
|
|
|
|
|
|
|
err = str.Set("cat")
|
|
|
|
|
|
|
|
require.Error(t, err)
|
|
|
|
|
|
|
|
}
|
|
|
|