gitlab-org--gitlab-foss/lib/container_registry/registry.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
618 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module ContainerRegistry
class Registry
attr_reader :uri, :client, :gitlab_api_client, :path
def initialize(uri, options = {})
2016-05-17 10:41:47 -04:00
@uri = uri
@options = options
@path = @options[:path] || default_path
@client = ContainerRegistry::Client.new(@uri, @options)
import_token = Auth::ContainerRegistryAuthenticationService.import_access_token
@gitlab_api_client = ContainerRegistry::GitlabApiClient.new(@uri, @options.merge(import_token: import_token))
end
2016-05-17 10:41:47 -04:00
private
def default_path
2018-01-27 00:35:53 -05:00
@uri.sub(%r{^https?://}, '')
2016-05-17 10:41:47 -04:00
end
end
end