Class: Rubernetes::Auth::Source

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/rubernetes/auth/source.rb

Overview

This class is used to decide on which auth mechanism to use (service_account? vs. kube_config?). It helps to run Rubernetes in development/local enviornments where a serviceaccount is missing.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSource

Returns a new instance of Source.



16
17
18
19
20
21
22
23
24
# File 'lib/rubernetes/auth/source.rb', line 16

def initialize
  @authenticator = if service_account?
                     ServiceAccount.new
                   elsif kube_config?
                     KubeConfig.new
                   else
                     raise Rubernetes::MissingAuthSource, 'Could not recognize authentication source'
                   end
end

Instance Attribute Details

#authenticatorObject

Returns the value of attribute authenticator.



14
15
16
# File 'lib/rubernetes/auth/source.rb', line 14

def authenticator
  @authenticator
end