Documentation
¶
Index ¶
- Variables
- func GenerateName(jobConfigName string, startTime time.Time) string
- func GetLabelScheduleTime(rj *execution.Job) *metav1.Time
- func GetLastScheduleTime(jobs []*execution.Job) *metav1.Time
- func GetLastStartTime(jobs []*execution.Job) *metav1.Time
- func GetState(rjc *execution.JobConfig) execution.JobConfigState
- func IsScheduleEnabled(jobConfig *execution.JobConfig) bool
- func LabelJobsForJobConfig(rjc *execution.JobConfig) labels.Set
- func LookupJobOwner(rj *execution.Job, lister lister.JobConfigNamespaceLister) (*execution.JobConfig, error)
- func NewJobFromJobConfig(jobConfig *execution.JobConfig, jobType execution.JobType, ...) (*execution.Job, error)
- func ValidateLookupJobOwner(rj *execution.Job, lister lister.JobConfigNamespaceLister) (*execution.JobConfig, field.ErrorList)
Constants ¶
This section is empty.
Variables ¶
var ( // AnnotationKeyScheduleTime stores the time that the Job was automatically scheduled // by the JobConfig's schedule spec. AnnotationKeyScheduleTime = executiongroup.AddGroupToLabel("schedule-time") // LabelKeyJobConfigUID stores the UID of the JobConfig that created the Job. // All Jobs are expected to have this label, which is used when using label // selectors. LabelKeyJobConfigUID = executiongroup.AddGroupToLabel("job-config-uid") // AnnotationKeyOptionSpecHash stores the hash of the OptionSpec at the point in // time when a Job's optionValues are evaluated based on the JobConfig's Option. AnnotationKeyOptionSpecHash = executiongroup.AddGroupToLabel("option-spec-hash") )
Functions ¶
func GenerateName ¶
GenerateName generates a unique name for a Job. Optionally pass a start time to make execution ID generation deterministic.
func GetLabelScheduleTime ¶
GetLabelScheduleTime returns the cron schedule time for a Job from its annotation. If no annotation exists or is not a valid Unix timestamp, nil will be returned.
func GetLastScheduleTime ¶
GetLastScheduleTime returns the latest schedule time in a list of all Jobs. If the list is empty, or none of the jobs were scheduled jobs, will return nil.
func GetLastStartTime ¶ added in v0.3.0
GetLastStartTime returns the latest StartTime in a list of all Jobs. If the list is empty, or none of the jobs were scheduled jobs, will return nil.
func GetState ¶
func GetState(rjc *execution.JobConfig) execution.JobConfigState
GetState returns the high-level state of a JobConfig.
func IsScheduleEnabled ¶ added in v0.3.0
IsScheduleEnabled returns true if the JobConfig has a schedule and is enabled.
func LabelJobsForJobConfig ¶
LabelJobsForJobConfig returns a labels.Set that labels all Jobs for a JobConfig.
func LookupJobOwner ¶
func LookupJobOwner(rj *execution.Job, lister lister.JobConfigNamespaceLister) (*execution.JobConfig, error)
LookupJobOwner looks up the JobConfig for a Job using the ownerReferences field if it exists. Otherwise, both a nil JobConfig and a nil error is returned if there are no owner references.
All Jobs with a JobConfig parent (specified via ownerReferences) are expected to have a special label (see LabelKeyJobConfigUID), which is used for internal selectors and cannot be updated.
func NewJobFromJobConfig ¶
func NewJobFromJobConfig( jobConfig *execution.JobConfig, jobType execution.JobType, createTime time.Time, ) (*execution.Job, error)
NewJobFromJobConfig returns a Job from a JobConfig.
func ValidateLookupJobOwner ¶
func ValidateLookupJobOwner( rj *execution.Job, lister lister.JobConfigNamespaceLister, ) (*execution.JobConfig, field.ErrorList)
ValidateLookupJobOwner looks up the owner JobConfig for a Job and returns validation errors if any.
All Jobs with a JobConfig parent (specified via ownerReferences) are expected to have a special label (see LabelKeyJobConfigUID), which is used for internal selectors and cannot be updated. This method also performs sanity checks to ensure that the returned JobConfig matches the UID fields in the Job.
May return a nil JobConfig if there is no owner reference defined.
Types ¶
This section is empty.