Sha256: 4115e23ecb55dbd6f5152c4e84ee1516bc7748df53e1a8c218e0f608b1ed1bcc

Contents?: true

Size: 688 Bytes

Versions: 31

Compression:

Stored size: 688 Bytes

Contents

module Kubes
  class Auth
    def initialize(image)
      @image = image
    end

    def run
      klass = strategy_class
      return unless klass
      klass.new(@image).run
    end

    # Currently only support ECR and GCR
    # TODO: consider moving this to plugin gems
    def strategy_class
      return unless auth?
      case @image
      when /\.amazonaws\.com/ # IE: 112233445566.dkr.ecr.us-west-2.amazonaws.com/demo/sinatra
        Ecr
      when /gcr\.io/
        Gcr
      end
    end

    def auth?
      if ENV['KUBES_REPO_AUTO_AUTH'].nil?
        Kubes.config.repo_auto_auth
      else
        %w[1 true].include?(ENV['KUBES_REPO_AUTO_AUTH'])
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
kubes-0.9.3 lib/kubes/auth.rb
kubes-0.9.2 lib/kubes/auth.rb
kubes-0.9.1 lib/kubes/auth.rb
kubes-0.9.0 lib/kubes/auth.rb
kubes-0.8.10 lib/kubes/auth.rb
kubes-0.8.9 lib/kubes/auth.rb
kubes-0.8.8 lib/kubes/auth.rb
kubes-0.8.7 lib/kubes/auth.rb
kubes-0.8.6 lib/kubes/auth.rb
kubes-0.8.5 lib/kubes/auth.rb
kubes-0.8.4 lib/kubes/auth.rb
kubes-0.8.3 lib/kubes/auth.rb
kubes-0.8.2 lib/kubes/auth.rb
kubes-0.8.1 lib/kubes/auth.rb
kubes-0.8.0 lib/kubes/auth.rb
kubes-0.7.10 lib/kubes/auth.rb
kubes-0.7.9 lib/kubes/auth.rb
kubes-0.7.8 lib/kubes/auth.rb
kubes-0.7.7 lib/kubes/auth.rb
kubes-0.7.6 lib/kubes/auth.rb