Documentation
¶
Overview ¶
Package docker resolves container image versions from a registry's tags, using Docker Hub's API for hub.docker.com and the OCI registry v2 bearer-token challenge elsewhere, piggybacking on the user's existing docker login for credentials.
Index ¶
- type Option
- type Provider
- func (p *Provider) Describe(r provider.Resource) string
- func (p *Provider) Digest(ctx context.Context, r provider.Resource, tag string) (string, error)
- func (p *Provider) Discover(ctx context.Context, r provider.Resource) ([]model.Candidate, error)
- func (p *Provider) Keys() []provider.Key
- func (p *Provider) Name() string
- func (p *Provider) Resource(d directive.Directive) (provider.Resource, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Provider)
Option configures a Provider.
func WithKeychain ¶
WithKeychain overrides the credential keychain, for tests.
func WithTransport ¶
func WithTransport(rt http.RoundTripper) Option
WithTransport overrides the HTTP transport, for tests.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider resolves versions from a container image registry's tags. The OCI registry protocol is shared with other providers via an oci.Client; docker adds Docker Hub's richer web API on top, whose token is resolved once and shared across a run.
func New ¶
New returns the Docker provider, defaulting to the keychain that reads the user's existing docker login (config.json plus any docker-credential-* helper), so clover piggybacks on credentials docker already stores.
func (*Provider) Digest ¶
Digest resolves the content digest a tag points at, delegating to the shared OCI client. A Hub reference resolves via the registry (not the web API), with credentials keyed under the Hub auth host - see [reference.manifestRepo].
func (*Provider) Discover ¶
Discover lists candidate versions for a resource from its registry tags, routing Docker Hub to its richer API and every other registry to the shared OCI registry v2 tags endpoint.