Class: Kuberun::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/kuberun/cli.rb

Overview

Handle the application command line parsing and the dispatch to various command objects

Constant Summary collapse

DEFAULT_OPTIONS_FOR_KUBECTL_OPTIONS =
{ type: :string, default: '', desc: 'See kubectl options' }
BASE_KUBECTL_OPTIONS =
{
  'certificate-authority': {},
  'client-certificate': {},
  'client-key': {},
  'cluster': {},
  'context': {},
  'insecure-skip-tls-verify': {},
  'kubeconfig': {},
  'namespace': { aliases: :'-n' },
  'token': {},
  'v': { type: :numeric, default: 0, desc: 'Log level, also passed to kubectl' },
}
Error =

Error raised by this runner

Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#run_pod(deployment_name) ⇒ Object



41
42
43
44
45
46
47
48
# File 'lib/kuberun/cli.rb', line 41

def run_pod(deployment_name)
  if options[:help]
    invoke :help, ['run_pod']
  else
    require_relative 'commands/run_pod'
    Kuberun::Commands::RunPod.new(deployment_name, options).execute
  end
end

#versionObject



32
33
34
35
# File 'lib/kuberun/cli.rb', line 32

def version
  require_relative 'version'
  puts "v#{Kuberun::VERSION}"
end