mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 11:18:16 +00:00
Add a custom timeout flag for stop/delete. Also try to be smarter about setting the timeout.
This commit is contained in:
@@ -63,6 +63,7 @@ func NewCmdStop(f *cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
cmd.Flags().Bool("all", false, "[-all] to select all the specified resources.")
|
||||
cmd.Flags().Bool("ignore-not-found", false, "Treat \"resource not found\" as a successful stop.")
|
||||
cmd.Flags().Int("grace-period", -1, "Period of time in seconds given to the resource to terminate gracefully. Ignored if negative.")
|
||||
cmd.Flags().Duration("timeout", 0, "The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object")
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -84,5 +85,5 @@ func RunStop(f *cmdutil.Factory, cmd *cobra.Command, args []string, filenames ut
|
||||
if r.Err() != nil {
|
||||
return r.Err()
|
||||
}
|
||||
return ReapResult(r, f, out, false, cmdutil.GetFlagBool(cmd, "ignore-not-found"), cmdutil.GetFlagInt(cmd, "grace-period"))
|
||||
return ReapResult(r, f, out, false, cmdutil.GetFlagBool(cmd, "ignore-not-found"), cmdutil.GetFlagDuration(cmd, "timeout"), cmdutil.GetFlagInt(cmd, "grace-period"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user