Documentation
¶
Overview ¶
Package dockerconfig builds and parses Kubernetes `.dockerconfigjson` payloads for imagePullSecret Secrets of type kubernetes.io/dockerconfigjson.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(creds []RegistryCredential) ([]byte, error)
Build encodes the given credentials into a canonical `.dockerconfigjson` byte slice. It computes the `auth` field (base64("user:pass")) automatically and rejects empty input.
Types ¶
type DockerAuthEntry ¶
type DockerAuthEntry struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Auth string `json:"auth,omitempty"`
}
DockerAuthEntry is one entry under auths[registry].
type DockerConfig ¶
type DockerConfig struct {
Auths map[string]DockerAuthEntry `json:"auths"`
}
DockerConfig is the top-level shape of .dockerconfigjson.
type RegistryCredential ¶
RegistryCredential is a single registry auth entry.
func Parse ¶
func Parse(data []byte) ([]RegistryCredential, error)
Parse decodes a `.dockerconfigjson` payload back into a flat list of credentials. The `auth` field is trusted only when username/password are missing; otherwise the explicit username/password are preferred.