Documentation
¶
Overview ¶
Package imagepull pulls images onto a node through the container runtime's image service (CRI), for the node-agent. Nothing from an image runs: the runtime only fetches and unpacks it, which is all a prepull needs, and the credentials of the pull are the tenant's own, handed over per request.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DockerConfigCredentials ¶
DockerConfigCredentials turns a kubernetes.io/dockerconfigjson document into the lookup Options.Credentials wants: the entry of the image's registry, nil (anonymous) when the document has none for it. An empty document means no credentials at all.
Types ¶
type Auth ¶
type Auth struct {
Username, Password string
}
Auth is the registry credential of one pull.
type CRIPuller ¶
type CRIPuller struct {
// contains filtered or unexported fields
}
CRIPuller pulls through the image service of the node's container runtime. Images land in the runtime's own namespace (the kubelet's), so the kubelet finds them.
func NewCRIPuller ¶
NewCRIPuller connects (lazily) to the CRI socket.
type Failure ¶
type Failure struct {
Image, Message string
}
Failure is an image that could not be pulled.
type Options ¶
type Options struct {
// Concurrency is how many images are pulled at once (2).
Concurrency int
// Timeout bounds one image (5m).
Timeout time.Duration
// Credentials returns the credential for an image's registry; nil or a nil Auth means anonymous.
Credentials func(ref string) *Auth
}
Options bound a Pull.
type Puller ¶
type Puller interface {
// Present reports whether the node already holds the image.
Present(ctx context.Context, ref string) (bool, error)
// Pull fetches the image; auth is nil for an anonymous pull.
Pull(ctx context.Context, ref string, auth *Auth) error
}
Puller is the container runtime's image service.
type Result ¶
Result is the outcome for one node: every image is in exactly one of the lists.