Sha256: 14a969425ffdd0fb8587660e05b98050343eeec085063a848af2549afeda8488

Contents?: true

Size: 741 Bytes

Versions: 17

Compression:

Stored size: 741 Bytes

Contents

# frozen_string_literal: true

require 'uffizzi/helpers/config_helper'
require 'uffizzi/services/kubeconfig_service'

class ClusterUpdateKubeconfigService
  class << self
    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
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
uffizzi-cli-2.4.11 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.4.10 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.4.9 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.4.8 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.4.7 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.4.6 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.4.5 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.4.4 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.4.3 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.4.2 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.4.1 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.4.0 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.3.4 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.3.3 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.3.2 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.3.1 lib/uffizzi/services/cluster/update_kubeconfig_service.rb
uffizzi-cli-2.3.0 lib/uffizzi/services/cluster/update_kubeconfig_service.rb