Documentation
¶
Overview ¶
Package upstream stores credentials for third-party registries (§5.9). Nodes pull public images directly from their registries; with a stored credential (e.g. a Docker Hub account against rate limits, or a private GHCR image) the controller passes it along with the pull.
Index ¶
- Constants
- func ImageHost(image string) string
- func NormalizeHost(h string) string
- type ErrInvalid
- type Manager
- func (m *Manager) Credential(ctx context.Context, host string) (string, string, bool)
- func (m *Manager) DockerConfigAuths(ctx context.Context) map[string]any
- func (m *Manager) Put(ctx context.Context, host, username, password string) (store.UpstreamCredential, error)
- func (m *Manager) RegistryAuth(ctx context.Context, image string) string
Constants ¶
const DockerHub = "docker.io"
DockerHub is the canonical host for Docker Hub images.
Variables ¶
This section is empty.
Functions ¶
func ImageHost ¶
ImageHost returns the registry host of an image reference, the way Docker resolves it: "nginx" and "acme/app" are on Docker Hub.
func NormalizeHost ¶
NormalizeHost maps Docker Hub's aliases to docker.io and lowercases.
Types ¶
type ErrInvalid ¶
type ErrInvalid struct{ Err error }
ErrInvalid wraps validation errors.
func (ErrInvalid) Error ¶
func (e ErrInvalid) Error() string
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) Credential ¶ added in v0.1.7
Credential returns the username and password stored for a registry host.
func (*Manager) DockerConfigAuths ¶
DockerConfigAuths are the "auths" of a Docker config.json holding every credential (for BuildKit pulling private FROM images).