image

package
v0.1.2-0...-3e0559f Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(ctx context.Context, logger io.StringWriter, expandedImageName string) (bool, error)

Exists check local references using a filter, this uses exact matching

func ExpandImageName

func ExpandImageName(imageWithTag string) (string, error)

func ExpandImageNameWithTag

func ExpandImageNameWithTag(image, tag string) (string, error)

func GetDefaultAuthConfig

func GetDefaultAuthConfig(checkCredStore bool, serverAddress string, isDefaultRegistry bool) (types.AuthConfig, error)

func GetImageByReference

func GetImageByReference(ctx context.Context, ref string) (*types.ImageSummary, error)

func GetRegistryURL

func GetRegistryURL(reg *string, registryAuth *RegistryAuth) string

func GetRegistryURLProto

func GetRegistryURLProto(reg *string, registryAuth *agent.RegistryAuth) string

func JSONStreamToStatusStream

func JSONStreamToStatusStream(respStream io.ReadCloser, stat *PullStatus) error

func Pull

func Pull(ctx context.Context, logger io.StringWriter, expandedImageName, authCreds string) error

force pulls the given image name TODO(nandor-magyar): the output from docker is not really nice, should be improved

func RegistryAuthenticationPrivilegedFunc

func RegistryAuthenticationPrivilegedFunc(index *registrytypes.IndexInfo, cmdName string) types.RequestPrivilegeFunc

func ResolveAuthConfig

func ResolveAuthConfig(_ context.Context, config string, index *registrytypes.IndexInfo) types.AuthConfig

func ResolveAuthFn

func ResolveAuthFn() func(ctx context.Context, index *registrytypes.IndexInfo) types.AuthConfig

func SplitImageName

func SplitImageName(expandedImageName string) (name, tag string, err error)

func TagTrusted

func TagTrusted(ctx context.Context, cli client.APIClient, trustedRef reference.Canonical, ref reference.NamedTagged) error

TagTrusted tags a trusted ref

Types

type DigestStatus

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

type PullResponse

type PullResponse struct {
	ID             string `json:"id"`
	Status         string `json:"status"`
	ProgressDetail struct {
		Current int64 `json:"current"`
		Total   int64 `json:"total"`
	} `json:"progressDetail"`
	Progress string `json:"progress"`
}

PullResponse is not explicit

type PullStatus

type PullStatus struct {
	RefsChan    map[string]chan DigestStatus
	LayerCount  int
	LayerCompl  int
	SumProgress float64
}

func MergePulls

func MergePulls(p1, p2 *PullStatus) *PullStatus

func PrettyImagePull

func PrettyImagePull(ctx context.Context, remote string) (*PullStatus, error)

type RegistryAuth

type RegistryAuth struct {
	Name     string `json:"name" binding:"required"`
	URL      string `json:"url" binding:"required"`
	User     string `json:"user" binding:"required"`
	Password string `json:"password" binding:"required"`
}

RegistryAuth defines an image registry and the authentication information associated with it.

Jump to

Keyboard shortcuts

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