common

package
v0.13.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShipwrightImagePrefix = "IMAGE_SHIPWRIGHT_"

	TektonOpMinSupportedVersion = "v0.50.0"
	TektonOpMinSupportedMajor   = 0
	TektonOpMinSupportedMinor   = 50

	Retain int = iota
	Overwrite
)

Variables

This section is empty.

Functions

func BoolFromEnvVar

func BoolFromEnvVar(envVar string) bool

func CRDExist

func CRDExist(ctx context.Context, client crdclientv1.ApiextensionsV1Interface, crdName string) (bool, error)

func Contains

func Contains(slice []string, str string) bool

contains returns true if the string if found in the slice.

func DeploymentImages

func DeploymentImages(images map[string]string) manifestival.Transformer

deploymentImages replaces container and env vars images.

func ImagesFromEnv

func ImagesFromEnv(prefix string) map[string]string

imagesFromEnv will provide map of key value.

func InjectAnnotations

func InjectAnnotations(key, value string, overwritePolicy int, kinds ...string) manifestival.Transformer

InjectAnnotations adds annotation key:value to a resource annotations overwritePolicy (Retain/Overwrite) decides whehther to overwrite an already existing annotation []kinds specify the Kinds on which the label should be applied if len(kinds) = 0, label will be apllied to all/any resources irrespective of its Kind

func IsOpenShiftPlatform

func IsOpenShiftPlatform() bool

func KoDataPath added in v0.13.0

func KoDataPath() (string, error)

KoDataPath retrieve the data path environment variable, returning error when not found.

func SetupManifestival

func SetupManifestival(client client.Client, fileOrDir string, recurse bool, logger logr.Logger) (manifestival.Manifest, error)

SetupManifestival instantiates a Manifestival instance for the provided file or directory

func ToLowerCaseKeys

func ToLowerCaseKeys(keyValues map[string]string) map[string]string

toLowerCaseKeys converts key value to lower cases.

func TruncateCRDFieldTransformer added in v0.13.0

func TruncateCRDFieldTransformer(field string, maxLength int) manifestival.Transformer

TruncateCRDFieldTransformer returns a manifestival.Transformer that truncates the value of the given field within a CRD spec to the provided max length.

Types

This section is empty.

Jump to

Keyboard shortcuts

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