Class: Ruboty::K8s::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/ruboty/k8s/config.rb

Class Method Summary collapse

Class Method Details

.client(cluster_name) ⇒ Object



6
7
8
# File 'lib/ruboty/k8s/config.rb', line 6

def client(cluster_name)
  config_yml[cluster_name]['client']
end

.config_file_pathObject



28
29
30
# File 'lib/ruboty/k8s/config.rb', line 28

def config_file_path
  @@config_file_path ||= ENV['RUBOTY_K8S_CONFIG_PATH']
end

.config_ymlObject



18
19
20
21
22
23
24
25
26
# File 'lib/ruboty/k8s/config.rb', line 18

def config_yml
  @@config_yml ||= begin
    YAML.load(
      ERB.new(
        open(config_file_path).read
      ).result
    )
  end
end

.deployments(cluster_name) ⇒ Object



10
11
12
# File 'lib/ruboty/k8s/config.rb', line 10

def deployments(cluster_name)
  config_yml[cluster_name]['deployments']
end

.has_cluster?(cluster_name) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/ruboty/k8s/config.rb', line 14

def has_cluster?(cluster_name)
  config_yml.keys.include?(cluster_name)
end

.set_config_file_path(file_path) ⇒ Object



32
33
34
# File 'lib/ruboty/k8s/config.rb', line 32

def set_config_file_path(file_path)
  @@config_file_path = file_path
end