Class: Kerbi::Cli::ReleaseHandler

Inherits:
BaseHandler show all
Defined in:
lib/cli/release_handler.rb

Instance Method Summary collapse

Instance Method Details

#delete(release_name) ⇒ Object



31
32
33
34
35
36
37
38
# File 'lib/cli/release_handler.rb', line 31

def delete(release_name)
  mem_dna(release_name)
  backend = state_backend
  return unless user_confirmed?
  old_signature = backend.resource_signature
  backend.delete
  echo("Deleted #{old_signature}")
end

#init(release_name) ⇒ Object

Parameters:

  • release_name (String)

    refers to a Kubernetes namespace



7
8
9
10
11
12
# File 'lib/cli/release_handler.rb', line 7

def init(release_name)
  mem_dna(release_name)
  state_backend.provision_missing_resources(verbose: run_opts.verbose?)
  ns_key = Kerbi::Consts::OptionSchemas::NAMESPACE
  Kerbi::ConfigFile.patch({ns_key => release_name})
end

#listObject



22
23
24
25
26
27
28
# File 'lib/cli/release_handler.rb', line 22

def list
  prep_opts(Kerbi::Consts::OptionDefaults::LIST_STATE)
  auth_bundle = Kerbi::Utils::Cli.make_k8s_auth_bundle(run_opts)
  backends = Kerbi::State::ConfigMapBackend.releases(auth_bundle)
  backends.each(&:prime)
  echo_data(backends, serializer: Kerbi::Cli::ReleaseSerializer)
end

#status(release_name) ⇒ Object



15
16
17
18
19
# File 'lib/cli/release_handler.rb', line 15

def status(release_name)
  mem_dna(release_name)
  backend = state_backend
  backend.test_connection(verbose: run_opts.verbose?)
end