Class: Kubes::Auth::Base

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/kubes/auth/base.rb

Direct Known Subclasses

Ecr, Gcr

Instance Method Summary collapse

Methods included from Logging

#logger

Constructor Details

#initialize(image) ⇒ Base

Returns a new instance of Base.



7
8
9
10
# File 'lib/kubes/auth/base.rb', line 7

def initialize(image)
  @image = image
  @repo_domain = "#{image.split('/').first}"
end

Instance Method Details

#docker_configObject



17
18
19
# File 'lib/kubes/auth/base.rb', line 17

def docker_config
  "#{ENV['HOME']}/.docker/config.json"
end

#ensure_dotdocker_existsObject



12
13
14
15
# File 'lib/kubes/auth/base.rb', line 12

def ensure_dotdocker_exists
  dirname = File.dirname(docker_config)
  FileUtils.mkdir_p(dirname) unless File.exist?(dirname)
end