Class: Krane::CLI::RunCommand
- Inherits:
-
Object
- Object
- Krane::CLI::RunCommand
- Defined in:
- lib/krane/cli/run_command.rb
Constant Summary collapse
- DEFAULT_RUN_TIMEOUT =
'300s'
- OPTIONS =
{ "global-timeout" => { type: :string, banner: "duration", desc: "Timeout error is raised if the pod runs for longer than the specified number of seconds", default: DEFAULT_RUN_TIMEOUT, }, "arguments" => { type: :string, banner: '"ARG1 ARG2 ARG3"', desc: "Override the default arguments for the command with a space-separated list of arguments", }, "verify-result" => { type: :boolean, desc: "Wait for completion and verify pod success", default: true }, "command" => { type: :array, desc: "Override the default command in the container image" }, "template" => { type: :string, desc: "The template file you'll be rendering", required: true, }, "env-vars" => { type: :string, banner: "VAR=val,FOO=bar", desc: "A Comma-separated list of env vars", default: '', }, }
Class Method Summary collapse
Class Method Details
.from_options(namespace, context, options) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/krane/cli/run_command.rb', line 35 def self.(namespace, context, ) require "kubernetes-deploy/runner_task" runner = KubernetesDeploy::RunnerTask.new( namespace: namespace, context: context, max_watch_seconds: KubernetesDeploy::DurationParser.new(["global-timeout"]).parse!.to_i, ) runner.run!( verify_result: ['verify-result'], task_template: ['template'], entrypoint: ['command'], args: ['arguments']&.split(" "), env_vars: ['env-vars'].split(','), ) end |