Merge pull request #4404 from VinGarcia/main

Fix flux install command so it returns an error when unexpected arguments are passed
This commit is contained in:
Max Jonas Werner 2023-11-27 18:19:10 +01:00 committed by GitHub
commit f20fe76168
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -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.`,

View file

@ -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 {