strategy

package
v0.0.0-alpha.0....-9b5d8e8 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DockerPushSecretMountPath            = "/var/run/secrets/openshift.io/push"
	DockerPullSecretMountPath            = "/var/run/secrets/openshift.io/pull"
	ConfigMapBuildSourceBaseMountPath    = "/var/run/configs/openshift.io/build"
	ConfigMapBuildSystemConfigsMountPath = "/var/run/configs/openshift.io/build-system"
	ConfigMapCertsMountPath              = "/var/run/configs/openshift.io/certs"
	SecretBuildSourceBaseMountPath       = "/var/run/secrets/openshift.io/build"
	SourceImagePullSecretMountPath       = "/var/run/secrets/openshift.io/source-image"
	// ConfigMapBuildGlobalCAMountPath is the directory where cluster-wide trust bundle will be
	// mounted in the build pod
	ConfigMapBuildGlobalCAMountPath = "/var/run/configs/openshift.io/pki"

	// ExtractImageContentContainer is the name of the container that will
	// pull down input images and extract their content for input to the build.
	ExtractImageContentContainer = "extract-image-content"

	// GitCloneContainer is the name of the container that will clone the
	// build source repository and also handle binary input content.
	GitCloneContainer = "git-clone"
)
View Source
const (
	CustomBuild = "custom-build"
	DockerBuild = "docker-build"
	StiBuild    = "sti-build"
)

Variables

View Source
var (
	// BuildControllerRefKind contains the schema.GroupVersionKind for builds.
	// This is used in the ownerRef of builder pods.
	BuildControllerRefKind = buildv1.GroupVersion.WithKind("Build")
)
View Source
var DefaultDropCaps = []string{
	"KILL",
	"MKNOD",
	"SETGID",
	"SETUID",
}

DefaultDropCaps is the list of capabilities to drop if the current user cannot run as root

Functions

func HasOwnerReference

func HasOwnerReference(pod *corev1.Pod, build *buildv1.Build) bool

HasOwnerReference returns true if the build pod has an OwnerReference to the build.

func IsFatal

func IsFatal(err error) bool

IsFatal returns true if the error is fatal

func NameForBuildVolume

func NameForBuildVolume(objName string) string

NameForBuildVolume returns a valid pod volume name for the provided build volume name.

func PathForBuildVolume

func PathForBuildVolume(objName string) string

PathForBuildVolume returns the path in the builder container where the build volume is mounted. This should not be confused with the destination path for the volume inside buildah's runtime environment.

Types

type CustomBuildStrategy

type CustomBuildStrategy struct {
}

CustomBuildStrategy creates a build using a custom builder image.

func (*CustomBuildStrategy) CreateBuildPod

func (bs *CustomBuildStrategy) CreateBuildPod(build *buildv1.Build, additionalCAs map[string]string, internalRegistryHost string) (*corev1.Pod, error)

CreateBuildPod creates the pod to be used for the Custom build

type DockerBuildStrategy

type DockerBuildStrategy struct {
	Image                  string
	BuildCSIVolumesEnabled bool
}

DockerBuildStrategy creates a Docker build using a Docker builder image.

func (*DockerBuildStrategy) CreateBuildPod

func (bs *DockerBuildStrategy) CreateBuildPod(build *buildv1.Build, additionalCAs map[string]string, internalRegistryHost string) (*v1.Pod, error)

CreateBuildPod creates the pod to be used for the Docker build TODO: Make the Pod definition configurable

type FatalError

type FatalError struct {
	// Reason the fatal error occurred
	Reason string
}

FatalError is an error which can't be retried.

func (*FatalError) Error

func (e *FatalError) Error() string

Error implements the error interface.

type SourceBuildStrategy

type SourceBuildStrategy struct {
	Image                   string
	SecurityClient          securityclient.SecurityV1Interface
	BuildCSIVolumeseEnabled bool
}

SourceBuildStrategy creates STI(source to image) builds

func (*SourceBuildStrategy) CreateBuildPod

func (bs *SourceBuildStrategy) CreateBuildPod(build *buildv1.Build, additionalCAs map[string]string, internalRegistryHost string) (*corev1.Pod, error)

CreateBuildPod creates a pod that will execute the STI build TODO: Make the Pod definition configurable

Jump to

Keyboard shortcuts

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