utils

package
v0.0.0-...-257a958 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ImageFormatEnv is the environment we use to hold the base pull spec
	ImageFormatEnv = "IMAGE_FORMAT"

	OverrideImageEnvPrefix = "OVERRIDE_IMAGE_"
)
View Source
const DefaultImageImportTimeout = 45 * time.Minute

Variables

This section is empty.

Functions

func ClusterPoolFromClaim

func ClusterPoolFromClaim(ctx context.Context, claim *api.ClusterClaim, hiveClient ctrlruntimeclient.Reader) (*hivev1.ClusterPool, error)

func EnvVarFor

func EnvVarFor(stream, name string) (string, error)

EnvVarFor determines the environment variable used to expose a pull spec for an ImageStreamTag in the test namespace to test workloads.

func FindStatusTag

func FindStatusTag(is *imagev1.ImageStream, tag string) (*coreapi.ObjectReference, string)

FindStatusTag returns an object reference to a tag if it exists in the ImageStream's Spec

func GetOverriddenImages

func GetOverriddenImages() map[string]string

GetOverriddenImages finds all occurrences of OVERRIDE_IMAGE_* in env vars, unescapes the tag name and maps it to its value

func ImageDigestFor

func ImageDigestFor(client ctrlruntimeclient.Client, namespace func() string, name, tag string) func() (string, error)

func InitialImageEnv

func InitialImageEnv(name string) string

InitialImageEnv determines the environment variable used to expose a pull spec for a initial ImageStreamTag in the test namespace to test workloads.

func IsInitialImageEnv

func IsInitialImageEnv(envVar string) bool

IsInitialImageEnv determines if an env var holds a pull spec for a tag under the initial image stream

func IsPipelineImageEnv

func IsPipelineImageEnv(envVar string) bool

IsPipelineImageEnv determines if an env var holds a pull spec for a tag under the pipeline image stream

func IsReleaseImageEnv

func IsReleaseImageEnv(envVar string) bool

IsReleaseImageEnv determines if an env var holds a pull spec for a tag under the release image stream

func IsStableImageEnv

func IsStableImageEnv(envVar string) bool

IsStableImageEnv determines if an env var holds a pull spec for a tag under the stable image stream

func LinkForEnv

func LinkForEnv(envVar string) (api.StepLink, bool)

LinkForEnv determines what step link was required by a user when they added a parameter to their template, if any.

func OverrideImageEnv

func OverrideImageEnv(name string) string

OverrideImageEnv generates the proper env var name for an image override

func PipelineImageEnvFor

func PipelineImageEnvFor(name api.PipelineImageStreamTagReference) string

PipelineImageEnvFor determines the environment variable used to expose a pull spec for a pipeline ImageStreamTag in the test namespace to test workloads.

func ReleaseImageEnv

func ReleaseImageEnv(name string) string

ReleaseImageEnv determines the environment variable used to expose a pull spec for a release ImageStreamTag in the test namespace to test workloads.

func ReleaseNameFrom

func ReleaseNameFrom(envVar string) string

ReleaseNameFrom determines the name of the release payload that the pull spec points to.

func StableImageEnv

func StableImageEnv(name string) string

StableImageEnv determines the environment variable used to expose a pull spec for a stable ImageStreamTag in the test namespace to test workloads.

func StableImageNameFrom

func StableImageNameFrom(envVar string) string

StableImageNameFrom gets an image name from an env name

func WaitForImportingISTag

func WaitForImportingISTag(ctx context.Context, client ctrlruntimeclient.WithWatch, ns, name string, into *imagev1.ImageStream, tags sets.Set[string], timeout time.Duration) error

WaitForImportingISTag waits for the tags on the image stream are imported

Types

This section is empty.

Jump to

Keyboard shortcuts

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