Skip to content

Commit

Permalink
Merge pull request #4404 from VinGarcia/main
Browse files Browse the repository at this point in the history
Fix flux install command so it returns an error when unexpected arguments are passed
  • Loading branch information
makkes authored Nov 27, 2023
2 parents c5b5263 + b596aef commit f20fe76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/flux/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (

var installCmd = &cobra.Command{
Use: "install",
Args: cobra.NoArgs,
Short: "Install or upgrade Flux",
Long: `The install command deploys Flux in the specified namespace.
If a previous version is installed, then an in-place upgrade will be performed.`,
Expand Down
5 changes: 5 additions & 0 deletions cmd/flux/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ func TestInstall(t *testing.T) {
args: "install --namespace='@#[]'",
assert: assertError("namespace must be a valid DNS label: \"@#[]\""),
},
{
name: "invalid sub-command",
args: "install unexpectedPosArg --namespace=example",
assert: assertError(`unknown command "unexpectedPosArg" for "flux install"`),
},
}

for _, tt := range tests {
Expand Down

0 comments on commit f20fe76

Please sign in to comment.