images

package
v0.0.0-...-4560a53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2023 License: Zlib Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Processing = Status("processing")
	Outdated   = Status("outdated")
	Updated    = Status("updated")
	Skipped    = Status("skipped")
	Preparing  = Status("preparing")
	Error      = Status("error")
)

Status constants

Variables

This section is empty.

Functions

func CacheResourceImageStatus

func CacheResourceImageStatus(resourceID string, status Status)

func EvictImageStatus

func EvictImageStatus(resourceID string)

func IsDanglingImage

func IsDanglingImage(image types.ImageInspect) bool

IsDanglingImage returns whether the given image is "dangling" which means that there are no repository references to the given image and it has no child images

func IsLocalImage

func IsLocalImage(image types.ImageInspect) bool

IsLocalImage checks if the image has been built locally

func IsNoTagImage

func IsNoTagImage(image types.ImageInspect) bool

IsNoTagImage returns whether the given image is damaged, has no tags

func ParseReference

func ParseReference(imageStr string) (types.ImageReference, error)

func ParseRepoDigest

func ParseRepoDigest(repoDigest string) digest.Digest

func ParseRepoDigests

func ParseRepoDigests(repoDigests []string) []digest.Digest

Types

type DigestClient

type DigestClient struct {
	// contains filtered or unexported fields
}

func NewClientWithRegistry

func NewClientWithRegistry(registryClient *RegistryClient, clientFactory *dockerclient.ClientFactory) *DigestClient

func (*DigestClient) ContainerImageStatus

func (c *DigestClient) ContainerImageStatus(ctx context.Context, containerID string, endpoint *portainer.Endpoint, nodeName string) (Status, error)

func (*DigestClient) ContainersImageStatus

func (c *DigestClient) ContainersImageStatus(ctx context.Context, containers []types.Container, endpoint *portainer.Endpoint) Status

func (*DigestClient) RemoteDigest

func (c *DigestClient) RemoteDigest(image Image) (digest.Digest, error)

func (*DigestClient) ServiceImageStatus

func (c *DigestClient) ServiceImageStatus(ctx context.Context, serviceID string, endpoint *portainer.Endpoint) (Status, error)

type Image

type Image struct {
	// Domain is the registry host of this image
	Domain string
	// Path may include username like portainer/portainer-ee, no Tag or Digest
	Path    string
	Tag     string
	Digest  digest.Digest
	HubLink string
	// contains filtered or unexported fields
}

Image holds information about an image.

func ParseImage

func ParseImage(parseOpts ParseImageOptions) (Image, error)

ParseImage returns an Image struct with all the values filled in for a given image.

func ParseLocalImage

func ParseLocalImage(inspect types.ImageInspect) (*Image, error)

func ParseRepoTag

func ParseRepoTag(repoTag string) *Image

func ParseRepoTags

func ParseRepoTags(repoTags []string) []*Image

func (*Image) FullName

func (i *Image) FullName() string

FullName return the real full name may include Tag or Digest of the image, Tag first.

func (*Image) Name

func (i *Image) Name() string

Name returns the full name representation of an image but no Tag or Digest.

func (*Image) Reference

func (i *Image) Reference() string

Reference returns either the digest if it is non-empty or the tag for the image.

func (*Image) String

func (i *Image) String() string

String returns the string representation of an image, including Tag and Digest if existed.

func (*Image) WithDigest

func (i *Image) WithDigest(digest digest.Digest) (err error)

WithDigest sets the digest for an image.

func (*Image) WithTag

func (i *Image) WithTag(tag string) (err error)

type ImageID

type ImageID string

type Options

type Options struct {
	Auth    imagetypes.DockerAuthConfig
	Timeout time.Duration
}

Options holds docker registry object options

type ParseImageOptions

type ParseImageOptions struct {
	Name   string
	HubTpl string
}

ParseImageOptions holds image options for parsing.

type Puller

type Puller struct {
	// contains filtered or unexported fields
}

func NewPuller

func NewPuller(client *client.Client, registryClient *RegistryClient, dataStore dataservices.DataStore) *Puller

func (*Puller) Pull

func (puller *Puller) Pull(ctx context.Context, image Image) error

type RegistryClient

type RegistryClient struct {
	// contains filtered or unexported fields
}

func NewRegistryClient

func NewRegistryClient(dataStore dataservices.DataStore) *RegistryClient

func (*RegistryClient) CertainRegistryAuth

func (c *RegistryClient) CertainRegistryAuth(registry *portainer.Registry) (string, string, error)

func (*RegistryClient) EncodedCertainRegistryAuth

func (c *RegistryClient) EncodedCertainRegistryAuth(registry *portainer.Registry) (string, error)

func (*RegistryClient) EncodedRegistryAuth

func (c *RegistryClient) EncodedRegistryAuth(image Image) (string, error)

func (*RegistryClient) RegistryAuth

func (c *RegistryClient) RegistryAuth(image Image) (string, string, error)

type Status

type Status string

Status holds Docker image analysis

func CachedImageDigest

func CachedImageDigest(resourceID string) (Status, error)

func CachedResourceImageStatus

func CachedResourceImageStatus(resourceID string) (Status, error)

func FigureOut

func FigureOut(statuses []Status) Status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL