Skip to content

Commit

Permalink
duration must be > 0 when targets flag specified
Browse files Browse the repository at this point in the history
  • Loading branch information
harp-intel committed Feb 14, 2025
1 parent c668797 commit 8f3f75a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ func validateFlags(cmd *cobra.Command, args []string) error {
if err != nil {
panic("failed to get target flag")
}
if flagDuration == 0 && target != "" {
targets, err := cmd.Flags().GetString("targets")
if err != nil {
panic("failed to get targets flag")
}
if flagDuration == 0 && (target != "" || targets != "") {
err := fmt.Errorf("duration must be greater than 0 when collecting from a remote target")
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
return err
Expand Down

0 comments on commit 8f3f75a

Please sign in to comment.