Class: Hetzner::K3s::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/hetzner/k3s/cli.rb', line 18

def self.exit_on_failure?
  true
end

Instance Method Details

#create_clusterObject



29
30
31
32
# File 'lib/hetzner/k3s/cli.rb', line 29

def create_cluster
  configuration.validate action: :create
  Cluster.new(configuration: configuration).create
end

#delete_clusterObject



36
37
38
39
# File 'lib/hetzner/k3s/cli.rb', line 36

def delete_cluster
  configuration.validate action: :delete
  Cluster.new(configuration: configuration).delete
end

#releasesObject



51
52
53
54
55
# File 'lib/hetzner/k3s/cli.rb', line 51

def releases
  Hetzner::Configuration.available_releases.each do |release|
    puts release
  end
end

#upgrade_clusterObject



45
46
47
48
# File 'lib/hetzner/k3s/cli.rb', line 45

def upgrade_cluster
  configuration.validate action: :upgrade
  Cluster.new(configuration: configuration).upgrade(new_k3s_version: options[:new_k3s_version], config_file: options[:config_file])
end

#versionObject



23
24
25
# File 'lib/hetzner/k3s/cli.rb', line 23

def version
  puts Hetzner::K3s::VERSION
end