class Krane::CLI::RunCommand

Constants

DEFAULT_RUN_TIMEOUT
OPTIONS

Public Class Methods

from_options(namespace, context, options) click to toggle source
# File lib/krane/cli/run_command.rb, line 35
def self.from_options(namespace, context, options)
  require "krane/runner_task"
  runner = ::Krane::RunnerTask.new(
    namespace: namespace,
    context: context,
    max_watch_seconds: ::Krane::DurationParser.new(options["global-timeout"]).parse!.to_i,
  )

  runner.run!(
    verify_result: options['verify-result'],
    task_template: options['template'],
    entrypoint: options['command'],
    args: options['arguments']&.split(" "),
    env_vars: options['env-vars'].split(','),
  )
end