Skip to content

Commit

Permalink
clamp timeout to minimum (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaudetcobello committed Jul 26, 2024
1 parent 1145e86 commit c7cb7c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/k8s/cmd/k8s/k8s_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ func newSetCmd(env cmdutil.ExecutionEnvironment) *cobra.Command {
Run: func(cmd *cobra.Command, args []string) {
config := apiv1.UserFacingClusterConfig{}

if opts.timeout < minTimeout {
cmd.PrintErrf("Timeout %v is less than minimum of %v. Using the minimum %v instead.\n", opts.timeout, minTimeout, minTimeout)
opts.timeout = minTimeout
}

for _, arg := range args {
if err := updateConfigMapstructure(&config, arg); err != nil {
cmd.PrintErrf("Error: Invalid option %q.\n\nThe error was: %v\n", arg, err)
Expand Down

0 comments on commit c7cb7c9

Please sign in to comment.