Skip to content

Commit

Permalink
Verify no args are passed to subctl gather
Browse files Browse the repository at this point in the history
Fixes #1083

Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
  • Loading branch information
tpantelis committed Mar 27, 2024
1 parent 53d5501 commit 7c74e78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/subctl/gather.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var gatherCmd = &cobra.Command{
Long: fmt.Sprintf("This command gathers information from a submariner cluster for troubleshooting. The information gathered "+
"can be selected by component (%v) and type (%v). Default is to capture all data.",
strings.Join(gather.AllModules.UnsortedList(), ","), strings.Join(gather.AllTypes.UnsortedList(), ",")),
Args: checkNoArguments,
Run: func(_ *cobra.Command, _ []string) {
if options.Directory == "" {
options.Directory = "submariner-" + time.Now().UTC().Format("20060102150405") // submariner-YYYYMMDDHHMMSS
Expand Down
4 changes: 4 additions & 0 deletions scripts/test/system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ function test_subctl_gather() {

# Broker (on the first cluster)
with_context "${broker}" validate_broker_resources

# Should error with an arg passed
_subctl gather all && exit 1

echo "::endgroup::"
}

Expand Down

0 comments on commit 7c74e78

Please sign in to comment.