Class: Kubes::Auth::Ecr
- Includes:
- Kubes::AwsServices
- Defined in:
- lib/kubes/auth/ecr.rb
Instance Method Summary collapse
Methods included from Kubes::AwsServices
Methods inherited from Base
#docker_config, #ensure_dotdocker_exists, #initialize
Methods included from Logging
Constructor Details
This class inherits a constructor from Kubes::Auth::Base
Instance Method Details
#fetch_auth_token ⇒ Object
37 38 39 |
# File 'lib/kubes/auth/ecr.rb', line 37 def fetch_auth_token ecr...first. end |
#run ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/kubes/auth/ecr.rb', line 20 def run auth_token = fetch_auth_token if File.exist?(docker_config) data = JSON.load(IO.read(docker_config)) data["auths"][@repo_domain] = {auth: auth_token} else data = {"auths" => {@repo_domain => {auth: auth_token}}} end # Handle legacy docker clients that still have old format with https:// legacy_entry = "https://#{@repo_domain}" data["auths"][legacy_entry] = {auth: auth_token} ensure_dotdocker_exists IO.write(docker_config, JSON.pretty_generate(data)) end |