buildutil

package
v0.0.0-alpha.0....-f299e54 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 16 Imported by: 7

Documentation

Index

Constants

View Source
const (
	// BuildStartedEventReason is the reason associated with the event registered when a build is started (pod is created).
	BuildStartedEventReason = "BuildStarted"
	// BuildStartedEventMessage is the message associated with the event registered when a build is started (pod is created).
	BuildStartedEventMessage = "Build %s/%s is now running"
	// BuildCompletedEventReason is the reason associated with the event registered when build completes successfully.
	BuildCompletedEventReason = "BuildCompleted"
	// BuildCompletedEventMessage is the message associated with the event registered when build completes successfully.
	BuildCompletedEventMessage = "Build %s/%s completed successfully"
	// BuildFailedEventReason is the reason associated with the event registered when build fails.
	BuildFailedEventReason = "BuildFailed"
	// BuildFailedEventMessage is the message associated with the event registered when build fails.
	BuildFailedEventMessage = "Build %s/%s failed"
	// BuildCancelledEventReason is the reason associated with the event registered when build is cancelled.
	BuildCancelledEventReason = "BuildCancelled"
	// BuildCancelledEventMessage is the message associated with the event registered when build is cancelled.
	BuildCancelledEventMessage = "Build %s/%s has been cancelled"
)
View Source
const (
	// NodePullSecretsPath is the file where node pull secrets are stored.
	NodePullSecretsPath = "/var/lib/kubelet/config.json"

	// BuildWorkDirMount is the working directory within the build pod, mounted as a volume.
	BuildWorkDirMount = "/tmp/build"

	// BuilderServiceAccountName is the name of the account used to run build pods by default.
	BuilderServiceAccountName = "builder"

	// BuildBlobsMetaCache is the directory used to store a cache for the blobs metadata to be
	// reused across builds.
	BuildBlobsMetaCache = "/var/lib/containers/cache"

	// BuildBlobsContentCache is the directory used to store a cache for the blobs content to be
	// reused within a build pod.
	BuildBlobsContentCache = "/var/cache/blobs"

	// GlobalCAConfigMapKey is the key into the config map data for the injected CA data
	GlobalCAConfigMapKey = "ca-bundle.crt"
)

Variables

This section is empty.

Functions

func BuildConfigBuilds

func BuildConfigBuilds(c buildclientv1.BuildsGetter, namespace, name string, filterFunc buildFilter) ([]*buildv1.Build, error)

BuildConfigBuilds return a list of builds for the given build config. Optionally you can specify a filter function to select only builds that matches your criteria.

func BuildConfigBuildsFromLister

func BuildConfigBuildsFromLister(lister buildlisterv1.BuildLister, namespace, name string, filterFunc buildFilter) ([]*buildv1.Build, error)

func BuildConfigSelector

func BuildConfigSelector(name string) labels.Selector

BuildConfigSelector returns a label Selector which can be used to find all builds for a BuildConfig.

func FetchServiceAccountSecrets

func FetchServiceAccountSecrets(secretStore v1lister.SecretLister, serviceAccountStore v1lister.ServiceAccountLister, namespace, serviceAccount string) ([]corev1.Secret, error)

FetchServiceAccountSecrets retrieves the Secrets used for pushing and pulling images from private container image registries.

func FindDockerSecretAsReference

func FindDockerSecretAsReference(secrets []corev1.Secret, image string) *corev1.LocalObjectReference

FindDockerSecretAsReference looks through a set of k8s Secrets to find one that represents Docker credentials and which contains credentials that are associated with the registry identified by the image. It returns a LocalObjectReference to the Secret, or nil if no match was found.

func GetBuildCAConfigMapName

func GetBuildCAConfigMapName(build *buildv1.Build) string

GetBuildCAConfigMapName returns the name of the ConfigMap containing the build's certificate authority bundles.

func GetBuildGlobalCAConfigMapName

func GetBuildGlobalCAConfigMapName(build *buildv1.Build) string

GetBuildGlobalCAConfigMapName returns the name of the ConfigMap containing the build's certificate authority bundles obtained from the proxy cfg

func GetBuildPodName

func GetBuildPodName(build *buildv1.Build) string

GetBuildPodName returns name of the build pod.

func GetBuildSystemConfigMapName

func GetBuildSystemConfigMapName(build *buildv1.Build) string

GetBuildSystemConfigMapName returns the name of the ConfigMap containing the build's registry configuration.

func GetImageChangeTriggerStatusForImageChangeTrigger

func GetImageChangeTriggerStatusForImageChangeTrigger(triggerSpec *buildv1.ImageChangeTrigger, bc *buildv1.BuildConfig) *buildv1.ImageChangeTriggerStatus

GetImageChangeTriggerStatusForImageChangeTrigger returns the ImageChangeTrigger entry in status that corresponds to the supplied ImageChangeTrigger entry in the spec.

func HasTriggerType

func HasTriggerType(triggerType buildv1.BuildTriggerType, bc *buildv1.BuildConfig) bool

func IsBuildComplete

func IsBuildComplete(build *buildv1.Build) bool

IsBuildComplete returns whether the provided build is complete or not

func IsTerminalPhase

func IsTerminalPhase(phase buildv1.BuildPhase) bool

IsTerminalPhase returns true if the provided phase is terminal

func LabelValue

func LabelValue(name string) string

LabelValue returns a string to use as a value for the Build label in a pod. If the length of the string parameter exceeds the maximum label length, the value will be truncated.

func MergeEnvWithoutDuplicates

func MergeEnvWithoutDuplicates(source []corev1.EnvVar, output *[]corev1.EnvVar, sourcePrecedence bool, whitelist []string)

MergeEnvWithoutDuplicates merges two environment lists without having duplicate items in the output list. If sourcePrecedence is true, keys in the source list will override keys in the output list.

func MergeTrustedEnvWithoutDuplicates

func MergeTrustedEnvWithoutDuplicates(source []corev1.EnvVar, output *[]corev1.EnvVar, sourcePrecedence bool)

MergeTrustedEnvWithoutDuplicates merges two environment lists without having duplicate items in the output list. The source list will be filtered such that only whitelisted environment variables are merged into the output list. If sourcePrecedence is true, keys in the source list will override keys in the output list.

func UpdateCustomImageEnv

func UpdateCustomImageEnv(strategy *buildv1.CustomBuildStrategy, newImage string)

UpdateCustomImageEnv updates base image env variable reference with the new image for a custom build strategy. If no env variable reference exists, create a new env variable.

Types

This section is empty.

Jump to

Keyboard shortcuts

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