Class: ClusterUpdateKubeconfigService

Inherits:
Object
  • Object
show all
Defined in:
lib/uffizzi/services/cluster/update_kubeconfig_service.rb

Class Method Summary collapse

Class Method Details

.say_error_update_kubeconfig(cluster_data) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/uffizzi/services/cluster/update_kubeconfig_service.rb', line 8

def say_error_update_kubeconfig(cluster_data)
  if ClusterService.failed?(cluster_data[:state])
    Uffizzi.ui.say_error_and_exit('Kubeconfig is empty because cluster failed to be created.')
  end

  if ClusterService.deploying?(cluster_data[:state])
    Uffizzi.ui.say_error_and_exit('Kubeconfig is empty because cluster is deploying.')
  end

  if ClusterService.deployed?(cluster_data[:state])
    raise Error.new("Cluster with data: #{cluster_data.to_json} is deployed but kubeconfig does not exist.")
  end
end