v0.8.1 Latest Latest

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

Go to latest
Published: Aug 20, 2019 License: Apache-2.0 Imports: 10 Imported by: 0




View Source
const (
	ActionExists = "exists"
	ActionCreate = "create"
	ActionDelete = "delete"


This section is empty.


func GetFirstTerminationMessage

func GetFirstTerminationMessage(pod *corev1.Pod) string

func GetJobPod

func GetJobPod(ctx context.Context, kubeClientset kubernetes.Interface, namespace, uid, operation string) (*corev1.Pod, error)

GetJobProd will find the Pod that belongs to the resource that created it. Uses label ""controller-uid as the label selector. So, your job should tag the job with that label as the UID of the resource that's needing it. For example, if you create a storage object that requires us to create a notification for it, the controller should set the label on the Job responsible for creating the Notification for it with the label "controller-uid" set to the uid of the storage CR.

func IsJobComplete

func IsJobComplete(job *batchv1.Job) bool

func IsJobFailed

func IsJobFailed(job *batchv1.Job) bool

func IsJobSucceeded

func IsJobSucceeded(job *batchv1.Job) bool

func JobFailedMessage

func JobFailedMessage(job *batchv1.Job) string

func JobLabels

func JobLabels(key string, parts ...string) map[string]string

JobLabels creates a label to find a job again. keys is recommended to be (name, kind, action)

func MakePodTemplate

func MakePodTemplate(image string, UID, action string, secret corev1.SecretKeySelector, extEnv ...corev1.EnvVar) *corev1.PodTemplateSpec

MakePodTemplate creates a pod template for a Job.


type OpsJobStatus

type OpsJobStatus string
const (
	OpsJobGetFailed          OpsJobStatus = "JOB_GET_FAILED"
	OpsJobCreated            OpsJobStatus = "JOB_CREATED"
	OpsJobCreateFailed       OpsJobStatus = "JOB_CREATE_FAILED"
	OpsJobCompleteSuccessful OpsJobStatus = "JOB_SUCCESSFUL"
	OpsJobCompleteFailed     OpsJobStatus = "JOB_FAILED"
	OpsJobOngoing            OpsJobStatus = "JOB_ONGOING"


Path Synopsis

Jump to

Keyboard shortcuts

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