imageutil

package
v1.115.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildImageAltNames

func BuildImageAltNames(rewrittenImage kustomizetypes.Image) ([]kustomizetypes.Image, error)

func ChangeImageTag added in v1.107.0

func ChangeImageTag(image string, newTag string) (string, error)

ChangeImageTag changes the tag of an image to the provided new tag

func DestECImage added in v1.112.0

func DestECImage(destRegistry registrytypes.RegistryOptions, srcImage string) (string, error)

DestECImage returns the location to push an embedded cluster image to on the dest registry

func DestImage

func DestImage(destRegistry registrytypes.RegistryOptions, srcImage string) (string, error)

DestImage returns the location to push the image to on the dest registry

func DestImageFromKustomizeImage

func DestImageFromKustomizeImage(image kustomizetypes.Image) string

DestImageFromKustomizeImage returns the location to push the image to from a kustomize image type

func GetImageName added in v1.107.0

func GetImageName(image string) string

GetImageName returns the name of the image without the tag, digest, or registry

func GetTag

func GetTag(imageRef string) (string, error)

GetTag extracts the image tag from an image reference

func KustomizeImage

func KustomizeImage(destRegistry registrytypes.RegistryOptions, image string) ([]kustomizetypes.Image, error)

func RewriteDockerArchiveImage

func RewriteDockerArchiveImage(registry registrytypes.RegistryOptions, nameParts []string) (kustomizetypes.Image, error)

func RewriteDockerRegistryImage

func RewriteDockerRegistryImage(destRegistry registrytypes.RegistryOptions, srcImage string) (*kustomizetypes.Image, error)

func SanitizeRepo added in v1.108.2

func SanitizeRepo(repo string) string

A valid repo may contain lowercase letters, digits and separators. A separator is defined as a period, one or two underscores, or one or more hyphens. A component may not start or end with a separator. ref: https://docs.docker.com/reference/cli/docker/image/tag/#description

func SanitizeTag added in v1.108.2

func SanitizeTag(tag string) string

A valid tag must be valid ASCII and can contain lowercase and uppercase letters, digits, underscores, periods, and hyphens. It can't start with a period or hyphen and must be no longer than 128 characters. ref: https://docs.docker.com/reference/cli/docker/image/tag/#description

func StripImageTagAndDigest

func StripImageTagAndDigest(image string) string

StripImageTagAndDigest removes the tag and digest from an image while preserving the original name. This can be helpful because parsing the image as a docker reference can modify the hostname (e.g. adds docker.io/library)

Types

type EmbeddedClusterArtifactOCIPathOptions added in v1.108.7

type EmbeddedClusterArtifactOCIPathOptions struct {
	RegistryHost      string
	RegistryNamespace string
	ChannelID         string
	UpdateCursor      string
	VersionLabel      string
}

type OCIArtifactPath added in v1.108.7

type OCIArtifactPath struct {
	Name              string
	RegistryHost      string
	RegistryNamespace string
	Repository        string
	Tag               string
}

func NewEmbeddedClusterOCIArtifactPath added in v1.108.7

func NewEmbeddedClusterOCIArtifactPath(filename string, opts EmbeddedClusterArtifactOCIPathOptions) *OCIArtifactPath

NewEmbeddedClusterOCIArtifactPath returns the OCI path for an embedded cluster artifact given the artifact filename and details about the configured registry and channel release.

func (*OCIArtifactPath) String added in v1.108.7

func (p *OCIArtifactPath) String() string

Jump to

Keyboard shortcuts

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