Class: Krane::CLI::RestartCommand
- Inherits:
-
Object
- Object
- Krane::CLI::RestartCommand
- Defined in:
- lib/krane/cli/restart_command.rb
Constant Summary collapse
- DEFAULT_RESTART_TIMEOUT =
'300s'
- OPTIONS =
{ "deployments" => { type: :array, banner: "list of deployments", desc: "List of workload names to restart" }, "global-timeout" => { type: :string, banner: "duration", default: DEFAULT_RESTART_TIMEOUT, desc: "Max duration to monitor workloads correctly restarted" }, "selector" => { type: :string, banner: "'label=value'", desc: "Select workloads by selector(s)" }, "verify-result" => { type: :boolean, default: true, desc: "Verify workloads correctly restarted" }, }
Class Method Summary collapse
Class Method Details
.from_options(namespace, context, options) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/krane/cli/restart_command.rb', line 18 def self.(namespace, context, ) require 'kubernetes-deploy/restart_task' selector = KubernetesDeploy::LabelSelector.parse([:selector]) if [:selector] restart = KubernetesDeploy::RestartTask.new( namespace: namespace, context: context, max_watch_seconds: KubernetesDeploy::DurationParser.new(["global-timeout"]).parse!.to_i, ) restart.run!( [:deployments], selector: selector, verify_result: ["verify-result"] ) end |