Remove implicit support for helm lint current directory

Signed-off-by: Terry Howe <terrylhowe@gmail.com>
pull/31294/head
copilot-swe-agent[bot] 5 days ago committed by Terry Howe
parent ff61915cda
commit 838c36a0f6
No known key found for this signature in database

@ -30,6 +30,7 @@ import (
"helm.sh/helm/v4/pkg/chart/common"
"helm.sh/helm/v4/pkg/chart/v2/lint/support"
"helm.sh/helm/v4/pkg/cli/values"
"helm.sh/helm/v4/pkg/cmd/require"
"helm.sh/helm/v4/pkg/getter"
)
@ -51,11 +52,9 @@ func newLintCmd(out io.Writer) *cobra.Command {
Use: "lint PATH",
Short: "examine a chart for possible issues",
Long: longLintHelp,
Args: require.MinimumNArgs(1),
RunE: func(_ *cobra.Command, args []string) error {
paths := []string{"."}
if len(args) > 0 {
paths = args
}
paths := args
if kubeVersion != "" {
parsedKubeVersion, err := common.ParseKubeVersion(kubeVersion)

@ -91,6 +91,15 @@ func TestLintCmdWithKubeVersionFlag(t *testing.T) {
runTestCmd(t, tests)
}
func TestLintCmdRequiresArgs(t *testing.T) {
tests := []cmdTestCase{{
name: "lint without arguments should fail",
cmd: "lint",
wantError: true,
}}
runTestCmd(t, tests)
}
func TestLintFileCompletion(t *testing.T) {
checkFileCompletion(t, "lint", true)
checkFileCompletion(t, "lint mypath", true) // Multiple paths can be given

Loading…
Cancel
Save