Skip to content

Commit

Permalink
fix(logs): Check for empty argument list (#745)
Browse files Browse the repository at this point in the history
Reviewed-by: Jakub Ciolek <jakub@unikraft.io>
Approved-by: Jakub Ciolek <jakub@unikraft.io>
  • Loading branch information
jake-ciolek authored Aug 25, 2023
2 parents f6ae3a5 + 52453ae commit 7a4e430
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/kraft/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ func (opts *Logs) Run(cmd *cobra.Command, args []string) error {
platform := mplatform.PlatformUnknown
var controller machineapi.MachineService

if len(args) == 0 {
return fmt.Errorf("must specify a machine to fetch logs for")
}

if opts.platform == "auto" {
controller, err = mplatform.NewMachineV1alpha1ServiceIterator(ctx)
} else {
Expand Down

0 comments on commit 7a4e430

Please sign in to comment.