Documentation
¶
Overview ¶
Package v1beta1 is the v1beta1 version of the API.
Index ¶
- Constants
- Variables
- func JobRunPodLabelFilterOption() internalinterfaces.TweakListOptionsFunc
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- func SetDefaultsFromJobDefinition(jr *JobRun, referredJD JobDefinition)
- type JobDefinition
- type JobDefinitionList
- type JobDefinitionSpec
- type JobDefinitionStatus
- type JobPodTemplate
- type JobRun
- func (jr *JobRun) AddLabel(key, value string, overwrite bool)
- func (j *JobRun) CheckCondition(t JobRunConditionType) bool
- func (in *JobRun) DeepCopy() *JobRun
- func (in *JobRun) DeepCopyInto(out *JobRun)
- func (in *JobRun) DeepCopyObject() runtime.Object
- func (j *JobRun) GetFailedIndices() map[int64]corev1.PodPhase
- func (j *JobRun) GetIndicesWithStatus(status corev1.PodPhase, indices []string) map[int64]corev1.PodPhase
- func (j *JobRun) GetSucceededIndices() map[int64]corev1.PodPhase
- func (j *JobRun) IsJobRunFinished() bool
- func (j *JobRun) IsRunningInDaemonMode() bool
- func (jr *JobRun) SetDefaults()
- func (jr *JobRun) SetOwner(jd *JobDefinition)
- func (j *JobRun) UpdateFailedIndices(podSnapshots map[int64]corev1.PodPhase)
- func (j *JobRun) UpdateStatusCounts(total int64, podStatus []corev1.PodPhase)
- func (j *JobRun) UpdateSucceededIndices(podSnapshots map[int64]corev1.PodPhase)
- type JobRunCondition
- type JobRunConditionType
- type JobRunList
- type JobRunSpec
- type JobRunStatus
Constants ¶
const ( // JobRunType pod type for jobRun. JobRunType = "jobrun" // JobIndex env name for job index. JobIndex = "JOB_INDEX" // CodeEngine Domain CEDomain = "CE_DOMAIN" // CodeEngine SubDomain CESubDomain = "CE_SUBDOMAIN" // CodeEngine Job CEJob = "CE_JOB" // CodeEngine Job Run CEJobRun = "CE_JOBRUN" // Mode for "daemon" Job Run CEExecutionMode = "CE_EXECUTION_MODE" CEExecutionModeValue = "DAEMON" // MaxIndexValue the max value of each index MaxIndexValue = 9999999 )
Variables ¶
var ( // LabelJobIndex is the label key for job index LabelJobIndex = fmt.Sprintf("%s/job-index", codeengine.GroupName) // LabelPodType is the label key for pod type LabelPodType = fmt.Sprintf("%s/pod-type", codeengine.GroupName) // LabelJobRun is the label key for job run LabelJobRun = fmt.Sprintf("%s/job-run", codeengine.GroupName) // LabelJobDefName is the label key for job definition name LabelJobDefName = fmt.Sprintf("%s/job-definition-name", codeengine.GroupName) // LabelJobDefUUID is the label key for job definition uuid LabelJobDefUUID = fmt.Sprintf("%s/job-definition-uuid", codeengine.GroupName) // AnnotationRetryTimes is the annotation key for retry times AnnotationRetryTimes = fmt.Sprintf("%s/retry-times", codeengine.GroupName) // AnnotationPodExpectations is the annotation key for counting pod expectations AnnotationPodExpectations = fmt.Sprintf("%s/pod-expectations", codeengine.GroupName) )
var ( // SchemeBuilder initializes a scheme builder SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme is a global function that registers this API group & version to a scheme AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: codeengine.GroupName, Version: "v1beta1"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func JobRunPodLabelFilterOption ¶
func JobRunPodLabelFilterOption() internalinterfaces.TweakListOptionsFunc
JobRunPodLabelFilterOption generate a TweakListOptionsFunc for jobRun pods
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
func SetDefaultsFromJobDefinition ¶
func SetDefaultsFromJobDefinition(jr *JobRun, referredJD JobDefinition)
SetDefaultsFromJobDefinition set defaults in place from its JobDefinitionRef: - Labels - Container name and image
Types ¶
type JobDefinition ¶
type JobDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec JobDefinitionSpec `json:"spec"`
Status JobDefinitionStatus `json:"status,omitempty"`
}
JobDefinition is a specification for a JobDefinition resource
func (*JobDefinition) DeepCopy ¶
func (in *JobDefinition) DeepCopy() *JobDefinition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobDefinition.
func (*JobDefinition) DeepCopyInto ¶
func (in *JobDefinition) DeepCopyInto(out *JobDefinition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*JobDefinition) DeepCopyObject ¶
func (in *JobDefinition) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type JobDefinitionList ¶
type JobDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []JobDefinition `json:"items"`
}
JobDefinitionList is a list of JobDefinition resources
func (*JobDefinitionList) DeepCopy ¶
func (in *JobDefinitionList) DeepCopy() *JobDefinitionList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobDefinitionList.
func (*JobDefinitionList) DeepCopyInto ¶
func (in *JobDefinitionList) DeepCopyInto(out *JobDefinitionList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*JobDefinitionList) DeepCopyObject ¶
func (in *JobDefinitionList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type JobDefinitionSpec ¶
type JobDefinitionSpec struct {
// Specifies the indices of pods to be created
// White spaces are allowed
// Example values are:
// 1,3,6,9
// 1-5, 7 - 8, 10
ArraySpec *string `json:"arraySpec,omitempty"`
// Number of retries before marking this job failed.
// The retry times will be RetryLimit + 1 if not specified.
// Default value is 3 if not set explicitly.
RetryLimit *int64 `json:"retryLimit,omitempty"`
// Specifies the duration in seconds relative to the startTime that the job may be active
// before the system tries to terminate it. Value must be positive integer
MaxExecutionTime *int64 `json:"maxExecutionTime,omitempty"`
// Specifies the template for creating copies of a pod
Template JobPodTemplate `json:"template,omitempty"`
}
JobDefinitionSpec is the spec for a jobDefinition resource
func (*JobDefinitionSpec) DeepCopy ¶
func (in *JobDefinitionSpec) DeepCopy() *JobDefinitionSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobDefinitionSpec.
func (*JobDefinitionSpec) DeepCopyInto ¶
func (in *JobDefinitionSpec) DeepCopyInto(out *JobDefinitionSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*JobDefinitionSpec) IsEmpty ¶
func (jds *JobDefinitionSpec) IsEmpty() bool
IsEmpty returns if the JobDefinitionSpec is empty
type JobDefinitionStatus ¶
type JobDefinitionStatus struct {
// Address holds the information needed for a Route to be the target of an event.
// Read-only, User cannot set it or update it
Address *duckv1.Addressable `json:"address,omitempty"`
}
JobDefinitionStatus is the current status of a jobDefinition resource
func (*JobDefinitionStatus) DeepCopy ¶
func (in *JobDefinitionStatus) DeepCopy() *JobDefinitionStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobDefinitionStatus.
func (*JobDefinitionStatus) DeepCopyInto ¶
func (in *JobDefinitionStatus) DeepCopyInto(out *JobDefinitionStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*JobDefinitionStatus) IsEmpty ¶
func (jds *JobDefinitionStatus) IsEmpty() bool
IsEmpty returns if the JobDefinitionStatus is empty
type JobPodTemplate ¶
type JobPodTemplate struct {
// List of containers belonging to the pod.
// Containers cannot currently be added or removed.
// There must be at least one container in a Pod.
// Cannot be updated.
Containers []corev1.Container `json:"containers,omitempty"`
// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
// If specified, these secrets will be passed to individual puller implementations for them to use. For example,
// in the case of docker, only DockerConfig type secrets are honored.
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
// ServiceAccountName is an optional string of the service account name which the generated pods should belong to
ServiceAccountName string `json:"serviceAccountName,omitempty"`
}
JobPodTemplate is the template of pod resource
func (*JobPodTemplate) DeepCopy ¶
func (in *JobPodTemplate) DeepCopy() *JobPodTemplate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobPodTemplate.
func (*JobPodTemplate) DeepCopyInto ¶
func (in *JobPodTemplate) DeepCopyInto(out *JobPodTemplate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*JobPodTemplate) IsEmpty ¶
func (t *JobPodTemplate) IsEmpty() bool
IsEmpty returns if the JobPodTemplate is empty
type JobRun ¶
type JobRun struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec JobRunSpec `json:"spec"`
Status JobRunStatus `json:"status"`
}
JobRun is a specification for a jobRun resource
func (*JobRun) CheckCondition ¶
func (j *JobRun) CheckCondition(t JobRunConditionType) bool
CheckCondition check if the condition exist in jobRun
func (*JobRun) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobRun.
func (*JobRun) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*JobRun) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*JobRun) GetFailedIndices ¶
GetFailedIndices get failed indices map from jr.Status.FailedIndices.
func (*JobRun) GetIndicesWithStatus ¶
func (*JobRun) GetSucceededIndices ¶
GetSucceededIndices get succeeded indices map from jr.Status.SucceededIndices.
func (*JobRun) IsJobRunFinished ¶
IsJobRunFinished check if the jobRun is finished
func (*JobRun) IsRunningInDaemonMode ¶
func (*JobRun) SetOwner ¶
func (jr *JobRun) SetOwner(jd *JobDefinition)
SetOwner sets the given JobDefiniton as OwnerReference With enabled BlockOwnerDeletion
func (*JobRun) UpdateFailedIndices ¶
UpdateFailedIndices updates jr.Status.FailedIndices.
func (*JobRun) UpdateStatusCounts ¶
UpdateStatusCounts updates job pods status counts.
type JobRunCondition ¶
type JobRunCondition struct {
// Type of JobRun condition, Complete or Failed.
Type JobRunConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=JobConditionType"`
// Status of the condition, one of True, False, Unknown.
Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"`
// Last time the condition was checked.
// +optional
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"`
// Last time the condition transit from one status to another.
// +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`
// (brief) reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`
// Human readable message indicating details about last transition.
// +optional
Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
}
JobRunCondition describes current state of a jobRun.
func (*JobRunCondition) DeepCopy ¶
func (in *JobRunCondition) DeepCopy() *JobRunCondition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobRunCondition.
func (*JobRunCondition) DeepCopyInto ¶
func (in *JobRunCondition) DeepCopyInto(out *JobRunCondition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type JobRunConditionType ¶
type JobRunConditionType string
JobRunConditionType are the condition types of JobRun
const ( // JobPending means the job has submitted into the system. JobPending JobRunConditionType = "Pending" // JobRunning means at least one job's pod running. JobRunning JobRunConditionType = "Running" // JobComplete means the job has completed its execution. JobComplete JobRunConditionType = "Complete" // JobFailed means the job has failed its execution. JobFailed JobRunConditionType = "Failed" )
These are valid conditions of a job.
type JobRunList ¶
type JobRunList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []JobRun `json:"items"`
}
JobRunList is a list of JobRunList resources
func (*JobRunList) DeepCopy ¶
func (in *JobRunList) DeepCopy() *JobRunList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobRunList.
func (*JobRunList) DeepCopyInto ¶
func (in *JobRunList) DeepCopyInto(out *JobRunList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*JobRunList) DeepCopyObject ¶
func (in *JobRunList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type JobRunSpec ¶
type JobRunSpec struct {
// The name of the jobDefinition that this jobRun refers
JobDefinitionRef string `json:"jobDefinitionRef"`
// The spec for a jobDefinition resource
JobDefinitionSpec JobDefinitionSpec `json:"jobDefinitionSpec,omitempty"`
}
JobRunSpec describes how the jobRun execution will look like
func (*JobRunSpec) DeepCopy ¶
func (in *JobRunSpec) DeepCopy() *JobRunSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobRunSpec.
func (*JobRunSpec) DeepCopyInto ¶
func (in *JobRunSpec) DeepCopyInto(out *JobRunSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*JobRunSpec) RequiresDefaultingFromJobDefinition ¶
func (js *JobRunSpec) RequiresDefaultingFromJobDefinition() bool
RequiresDefaultingFromJobDefinition return true if JobRun refers to a jobDefinition.
func (*JobRunSpec) SetDefaults ¶
func (js *JobRunSpec) SetDefaults()
SetDefaults sets defaults for JobRun Spec.
type JobRunStatus ¶
type JobRunStatus struct {
// Represents time when the job was acknowledged by the job controller.
// It is not guaranteed to be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
StartTime *metav1.Time `json:"startTime,omitempty"`
// Represents time when the job was completed. It is not guaranteed to
// be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
CompletionTime *metav1.Time `json:"completionTime,omitempty"`
// List of JobRun indices that failed.
// It contains
// - single JobRun index notation: 1,3,5
// - range JobRun index notation: 1-3,6-9
// - mixed Jobrun index notation: 1,3-4,6,8-9
FailedIndices *string `json:"failedIndices,omitempty"`
// List of JobRun indices that succeeded.
// List can be a comma-separated list of index ranges.
SucceededIndices *string `json:"succeededIndices,omitempty"`
// The latest available observations of an object's current state.
// +optional
Conditions []JobRunCondition `json:"conditions,omitempty"`
// The number of pods which reached phase Unknown.
// +optional
Unknown int64 `json:"unknown,omitempty"`
// The number of pods which reached phase Pending.
// +optional
Pending int64 `json:"pending,omitempty"`
// The number of pods which reached phase Running.
// +optional
Running int64 `json:"running,omitempty"`
// The number of pods which reached phase Succeeded.
// +optional
Succeeded int64 `json:"succeeded,omitempty"`
// The number of pods which reached phase Failed.
// +optional
Failed int64 `json:"failed,omitempty"`
// The number of pods which are requested but not created.
// +optional
Requested int64 `json:"requested,omitempty"`
}
JobRunStatus is the current status of a jobRun resource
func (*JobRunStatus) AddCondition ¶
func (s *JobRunStatus) AddCondition(new JobRunCondition)
AddCondition sets or updates new condition on conditions, put down condition when update.
func (*JobRunStatus) DeepCopy ¶
func (in *JobRunStatus) DeepCopy() *JobRunStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobRunStatus.
func (*JobRunStatus) DeepCopyInto ¶
func (in *JobRunStatus) DeepCopyInto(out *JobRunStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*JobRunStatus) GetCondition ¶
func (s *JobRunStatus) GetCondition(t JobRunConditionType) *JobRunCondition
GetCondition fetches the condition of the specified type.
func (*JobRunStatus) GetLatestCondition ¶
func (s *JobRunStatus) GetLatestCondition() *JobRunCondition
GetLatestCondition returns latest condition or nil, if the jobRun does not have a condition yet.