diff --git a/cmd/manager.go b/cmd/manager.go index fdde95552..b22e3a1fd 100644 --- a/cmd/manager.go +++ b/cmd/manager.go @@ -59,10 +59,11 @@ func init() { managerCmd.PersistentFlags().StringSliceVar(&sbm.BundleCollectors, "extra-collectors", getEnvStringSlice("SUPPORT_BUNDLE_EXTRA_COLLECTORS"), "Get extra resource for the specific components e.g., harvester") managerCmd.PersistentFlags().StringVar(&sbm.Description, "description", os.Getenv("SUPPORT_BUNDLE_DESCRIPTION"), "The support bundle description") managerCmd.PersistentFlags().StringVar(&sbm.IssueURL, "issue-url", os.Getenv("SUPPORT_BUNDLE_ISSUE_URL"), "The support bundle issue url") - managerCmd.PersistentFlags().DurationVar(&sbm.NodeTimeout, "node-timeout", parseNodeTimeout(os.Getenv("SUPPORT_BUNDLE_NODE_TIMEOUT")), "The support bundle node collection time out") + managerCmd.PersistentFlags().DurationVar(&sbm.NodeTimeout, "node-timeout", parseDurationString(os.Getenv("SUPPORT_BUNDLE_NODE_TIMEOUT")), "The support bundle node collection time out") } -func parseNodeTimeout(value string) time.Duration { +// parseDurationString could parse `1s` and `10m` duration string. +func parseDurationString(value string) time.Duration { if value == "" { return 0 }