Class: KubernetesDeploy::KubeclientBuilder::KubeConfig

Inherits:
Kubeclient::Config
  • Object
show all
Defined in:
lib/kubernetes-deploy/kubeclient_builder/kube_config.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.read(filename) ⇒ Object



7
8
9
10
# File 'lib/kubernetes-deploy/kubeclient_builder/kube_config.rb', line 7

def self.read(filename)
  parsed = YAML.safe_load(File.read(filename), [Date, Time])
  new(parsed, File.dirname(filename))
end

Instance Method Details

#fetch_user_auth_options(user) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/kubernetes-deploy/kubeclient_builder/kube_config.rb', line 12

def fetch_user_auth_options(user)
  if user.dig('auth-provider', 'name') == 'gcp'
    { bearer_token: Kubeclient::GoogleApplicationDefaultCredentials.token }
  else
    super
  end
end