(rootCmd *cobra.Command)
| 196 | } |
| 197 | |
| 198 | func setFlags(rootCmd *cobra.Command) { |
| 199 | traceFlag := &pflag.Flag{ |
| 200 | Name: "trace", |
| 201 | Usage: "enable trace logging, set one or more comma separated values: none,all," + tracing.All.String(), |
| 202 | Value: &enabledTraces, |
| 203 | DefValue: enabledTraces.String(), |
| 204 | NoOptDefVal: tracing.Default.String(), |
| 205 | } |
| 206 | rootCmd.PersistentFlags().AddFlag(traceFlag) |
| 207 | |
| 208 | rootCmd.PersistentFlags().BoolVar(&quiet, "quiet", quiet, "less verbose output") |
| 209 | rootCmd.PersistentFlags().BoolVar(&verbose, "verbose", verbose, "more verbose output") |
| 210 | rootCmd.PersistentFlags().BoolVar(&debug, "debug", debug, "same as verbose but also show function names and line numbers") |
| 211 | rootCmd.PersistentFlags().DurationVar(&globalTimeout, "timeout", globalTimeout, "max overall execution duration") |
| 212 | rootCmd.PersistentFlags().StringVar(&logfile, "logfile", "", "file to write the logging output. If not specified logging output will be written to stderr") |
| 213 | |
| 214 | // Retry configuration flags |
| 215 | rootCmd.PersistentFlags().DurationVar(&retryMaxWait, "retry-max-wait", retryMaxWait, "maximum wait time between retries") |
| 216 | rootCmd.PersistentFlags().IntVar(&retryMaxRetry, "retry-max-retry", retryMaxRetry, "maximum number of retry attempts") |
| 217 | rootCmd.PersistentFlags().DurationVar(&retryDuration, "retry-duration", retryDuration, "base duration for exponential backoff calculation") |
| 218 | rootCmd.PersistentFlags().Float64Var(&retryFactor, "retry-factor", retryFactor, "exponential backoff multiplier") |
| 219 | rootCmd.PersistentFlags().Float64Var(&retryJitter, "retry-jitter", retryJitter, "randomness factor for backoff calculation (0.0-1.0)") |
| 220 | |
| 221 | kubernetes.AddKubeconfigFlag(rootCmd) |
| 222 | } |
no test coverage detected