Documentation ¶
Overview ¶
Package decorate is a library for adding to a user-provided PodSpec in order to create a full Pod that will fulfill a test job
Index ¶
- Constants
- func BlobStorageOptions(dc prowapi.DecorationConfig, localMode bool) ([]coreapi.Volume, []coreapi.VolumeMount, gcsupload.Options)
- func CloneLogPath(logMount coreapi.VolumeMount) string
- func CloneRefs(pj prowapi.ProwJob, codeMount, logMount coreapi.VolumeMount) (*coreapi.Container, []prowapi.Refs, []coreapi.Volume, error)
- func CodeMountAndVolume() (coreapi.VolumeMount, coreapi.Volume)
- func DetermineWorkDir(baseDir string, refs []prowapi.Refs) string
- func InitUpload(config *prowapi.DecorationConfig, gcsOptions gcsupload.Options, ...) (*coreapi.Container, error)
- func InjectEntrypoint(c *coreapi.Container, timeout, gracePeriod time.Duration, ...) (*wrapper.Options, error)
- func KubeEnv(environment map[string]string) []coreapi.EnvVar
- func Labels() []string
- func LabelsAndAnnotationsForJob(pj prowapi.ProwJob) (map[string]string, map[string]string)
- func LabelsAndAnnotationsForSpec(spec prowapi.ProwJobSpec, extraLabels, extraAnnotations map[string]string) (map[string]string, map[string]string)
- func LogMountAndVolume() (coreapi.VolumeMount, coreapi.Volume)
- func PlaceEntrypoint(config *prowapi.DecorationConfig, toolsMount coreapi.VolumeMount) coreapi.Container
- func PodUtilsContainerNames() sets.String
- func ProwJobToPod(pj prowapi.ProwJob) (*coreapi.Pod, error)
- func ProwJobToPodLocal(pj prowapi.ProwJob, outputDir string) (*coreapi.Pod, error)
- func Sidecar(config *prowapi.DecorationConfig, gcsOptions gcsupload.Options, ...) (*coreapi.Container, error)
- func ToolsMountAndVolume() (coreapi.VolumeMount, coreapi.Volume)
- func VolumeMountPathsOnTestContainer() sets.String
- func VolumeMounts(dc *prowapi.DecorationConfig) sets.String
- func VolumeMountsOnTestContainer() sets.String
Constants ¶
const ( // RequirePassingEntries causes sidecar to return an error if any entry fails. Otherwise it exits cleanly so long as it can complete. RequirePassingEntries = true )
Variables ¶
This section is empty.
Functions ¶
func BlobStorageOptions ¶
func BlobStorageOptions(dc prowapi.DecorationConfig, localMode bool) ([]coreapi.Volume, []coreapi.VolumeMount, gcsupload.Options)
func CloneLogPath ¶
func CloneLogPath(logMount coreapi.VolumeMount) string
CloneLogPath returns the path to the clone log file in the volume mount. CloneLogPath returns the path to the clone log file in the volume mount.
func CloneRefs ¶
func CloneRefs(pj prowapi.ProwJob, codeMount, logMount coreapi.VolumeMount) (*coreapi.Container, []prowapi.Refs, []coreapi.Volume, error)
CloneRefs constructs the container and volumes necessary to clone the refs requested by the ProwJob.
The container checks out repositories specified by the ProwJob Refs to `codeMount`. A log of what it checked out is written to `clone.json` in `logMount`.
The container may need to mount SSH keys and/or cookiefiles in order to access private refs. CloneRefs returns a list of volumes containing these secrets required by the container.
func CodeMountAndVolume ¶
func CodeMountAndVolume() (coreapi.VolumeMount, coreapi.Volume)
CodeMountAndVolume returns the canonical volume and mount used to share code under test
func DetermineWorkDir ¶
DetermineWorkDir determines the working directory to use for a given set of refs to clone
func InitUpload ¶
func InitUpload(config *prowapi.DecorationConfig, gcsOptions gcsupload.Options, blobStorageMounts []coreapi.VolumeMount, cloneLogMount *coreapi.VolumeMount, outputMount *coreapi.VolumeMount, encodedJobSpec string) (*coreapi.Container, error)
func InjectEntrypoint ¶
func InjectEntrypoint(c *coreapi.Container, timeout, gracePeriod time.Duration, prefix, previousMarker string, exitZero bool, log, tools coreapi.VolumeMount) (*wrapper.Options, error)
InjectEntrypoint will make the entrypoint binary in the tools volume the container's entrypoint, which will output to the log volume.
func KubeEnv ¶
KubeEnv transforms a mapping of environment variables into their serialized form for a PodSpec, sorting by the name of the env vars
func LabelsAndAnnotationsForJob ¶
LabelsAndAnnotationsForJob returns a standard set of labels to add to pod/build/etc resources.
func LabelsAndAnnotationsForSpec ¶
func LabelsAndAnnotationsForSpec(spec prowapi.ProwJobSpec, extraLabels, extraAnnotations map[string]string) (map[string]string, map[string]string)
LabelsAndAnnotationsForSpec returns a minimal set of labels to add to prowjobs or its owned resources.
User-provided extraLabels and extraAnnotations values will take precedence over auto-provided values.
func LogMountAndVolume ¶
func LogMountAndVolume() (coreapi.VolumeMount, coreapi.Volume)
LogMountAndVolume returns the canonical volume and mount used to persist container logs.
func PlaceEntrypoint ¶
func PlaceEntrypoint(config *prowapi.DecorationConfig, toolsMount coreapi.VolumeMount) coreapi.Container
PlaceEntrypoint will copy entrypoint from the entrypoint image to the tools volume
func PodUtilsContainerNames ¶
PodUtilsContainerNames returns a string set with pod utility container name consts in it.
func ProwJobToPod ¶
ProwJobToPod converts a ProwJob to a Pod that will run the tests.
func ProwJobToPodLocal ¶
ProwJobToPodLocal converts a ProwJob to a Pod that will run the tests. If an output directory is specified, files are copied to the dir instead of uploading to GCS if decoration is configured.
func Sidecar ¶
func Sidecar(config *prowapi.DecorationConfig, gcsOptions gcsupload.Options, blobStorageMounts []coreapi.VolumeMount, logMount coreapi.VolumeMount, outputMount *coreapi.VolumeMount, encodedJobSpec string, requirePassingEntries, ignoreInterrupts bool, secretVolumeMounts []coreapi.VolumeMount, wrappers ...wrapper.Options) (*coreapi.Container, error)
func ToolsMountAndVolume ¶
func ToolsMountAndVolume() (coreapi.VolumeMount, coreapi.Volume)
ToolsMountAndVolume returns the canonical volume and mount used to propagate the entrypoint
func VolumeMountPathsOnTestContainer ¶
VolumeMountPathsOnTestContainer returns a string set with *MountPath consts in it which are applied to the test container.
func VolumeMounts ¶
func VolumeMounts(dc *prowapi.DecorationConfig) sets.String
VolumeMounts returns a string set with *MountName consts in it.
func VolumeMountsOnTestContainer ¶
VolumeMountsOnTestContainer returns a string set with *MountName consts in it which are applied to the test container.
Types ¶
This section is empty.