Documentation ¶
Index ¶
Constants ¶
const ( // ExtendedJobResourceKind is the kind name of ExtendedJob ExtendedJobResourceKind = "ExtendedJob" // ExtendedJobResourcePlural is the plural name of ExtendedJob ExtendedJobResourcePlural = "extendedjobs" )
Variables ¶
var ( // AddToScheme is used for schema registrations in the controller package // and also in the generated kube code AddToScheme = schemeBuilder.AddToScheme // ExtendedJobResourceShortNames is the short names of ExtendedJob ExtendedJobResourceShortNames = []string{"ejob", "ejobs"} // ExtendedJobValidation is the validation method for ExtendedJob ExtendedJobValidation = extv1.CustomResourceValidation{ OpenAPIV3Schema: &extv1.JSONSchemaProps{ Type: "object", Properties: map[string]extv1.JSONSchemaProps{ "spec": { Type: "object", Properties: map[string]extv1.JSONSchemaProps{ "output": { Type: "object", Properties: map[string]extv1.JSONSchemaProps{ "namePrefix": { Type: "string", }, "outputType": { Type: "string", }, "secretLabels": { Type: "object", }, "writeOnFailure": { Type: "boolean", }, }, Required: []string{ "namePrefix", }, }, "trigger": { Type: "object", Properties: map[string]extv1.JSONSchemaProps{ "strategy": { Type: "string", Enum: []extv1.JSON{ { Raw: []byte(`"manual"`), }, { Raw: []byte(`"once"`), }, { Raw: []byte(`"now"`), }, { Raw: []byte(`"done"`), }, }, }, "when": { Type: "string", Enum: []extv1.JSON{ { Raw: []byte(`"ready"`), }, { Raw: []byte(`"notready"`), }, { Raw: []byte(`"created"`), }, { Raw: []byte(`"deleted"`), }, }, }, "selector": { Type: "object", }, }, Required: []string{ "strategy", }, }, "template": { Type: "object", }, "updateOnConfigChange": { Type: "boolean", }, }, }, }, }, } // ExtendedJobResourceName is the resource name of ExtendedJob ExtendedJobResourceName = fmt.Sprintf("%s.%s", ExtendedJobResourcePlural, apis.GroupName) // SchemeGroupVersion is group version used to register these objects SchemeGroupVersion = schema.GroupVersion{Group: apis.GroupName, Version: "v1alpha1"} )
var ( // LabelReferencedJobName is the name key for dependent job LabelReferencedJobName = fmt.Sprintf("%s/referenced-job-name", apis.GroupName) // LabelPersistentSecretContainer is a label used for persisted secrets, // identifying the container that created them LabelPersistentSecretContainer = fmt.Sprintf("%s/container-name", apis.GroupName) // LabelInstanceGroup is a label for persisted secrets, identifying // the instance group they belong to LabelInstanceGroup = fmt.Sprintf("%s/instance-group", apis.GroupName) // LabelExtendedJob key for label used to identify extendedjob. Value // is set to true if the batchv1.Job is from an ExtendedJob LabelExtendedJob = fmt.Sprintf("%s/extendedjob", apis.GroupName) // LabelEJobName key for label on a batchv1.Job's pod, which is set to the ExtendedJob's name LabelEJobName = fmt.Sprintf("%s/ejob-name", apis.GroupName) // LabelTriggeringPod key for label, which is set to the UID of the pod that triggered an ExtendedJob LabelTriggeringPod = fmt.Sprintf("%s/triggering-pod", apis.GroupName) )
Functions ¶
func Kind ¶
Kind takes an unqualified kind and returns back a Group qualified GroupKind
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
Types ¶
type ExtendedJob ¶
type ExtendedJob struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec ExtendedJobSpec `json:"spec,omitempty"` Status ExtendedJobStatus `json:"status,omitempty"` }
ExtendedJob is the Schema for the extendedstatefulsetcontroller API +k8s:openapi-gen=true
func (*ExtendedJob) DeepCopy ¶
func (in *ExtendedJob) DeepCopy() *ExtendedJob
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtendedJob.
func (*ExtendedJob) DeepCopyInto ¶
func (in *ExtendedJob) DeepCopyInto(out *ExtendedJob)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ExtendedJob) DeepCopyObject ¶
func (in *ExtendedJob) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ExtendedJob) IsAutoErrand ¶
func (e *ExtendedJob) IsAutoErrand() bool
IsAutoErrand returns true if this ext job is an auto errand
func (*ExtendedJob) ToBeDeleted ¶
func (e *ExtendedJob) ToBeDeleted() bool
ToBeDeleted checks whether this ExtendedJob has been marked for deletion
type ExtendedJobList ¶
type ExtendedJobList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []ExtendedJob `json:"items"` }
ExtendedJobList contains a list of ExtendedJob
func (*ExtendedJobList) DeepCopy ¶
func (in *ExtendedJobList) DeepCopy() *ExtendedJobList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtendedJobList.
func (*ExtendedJobList) DeepCopyInto ¶
func (in *ExtendedJobList) DeepCopyInto(out *ExtendedJobList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ExtendedJobList) DeepCopyObject ¶
func (in *ExtendedJobList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ExtendedJobSpec ¶
type ExtendedJobSpec struct { Output *Output `json:"output,omitempty"` Trigger Trigger `json:"trigger"` Template corev1.PodTemplateSpec `json:"template"` UpdateOnConfigChange bool `json:"updateOnConfigChange"` }
ExtendedJobSpec defines the desired state of ExtendedJob
func (*ExtendedJobSpec) DeepCopy ¶
func (in *ExtendedJobSpec) DeepCopy() *ExtendedJobSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtendedJobSpec.
func (*ExtendedJobSpec) DeepCopyInto ¶
func (in *ExtendedJobSpec) DeepCopyInto(out *ExtendedJobSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ExtendedJobStatus ¶
type ExtendedJobStatus struct { LastReconcile *metav1.Time `json:"lastReconcile"` Nodes []string `json:"nodes"` }
ExtendedJobStatus defines the observed state of ExtendedJob
func (*ExtendedJobStatus) DeepCopy ¶
func (in *ExtendedJobStatus) DeepCopy() *ExtendedJobStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtendedJobStatus.
func (*ExtendedJobStatus) DeepCopyInto ¶
func (in *ExtendedJobStatus) DeepCopyInto(out *ExtendedJobStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Output ¶
type Output struct { NamePrefix string `json:"namePrefix"` // the secret name will be <NamePrefix><container name> OutputType string `json:"outputType,omitempty"` // only json is supported for now SecretLabels map[string]string `json:"secretLabels,omitempty"` WriteOnFailure bool `json:"writeOnFailure,omitempty"` Versioned bool `json:"versioned,omitempty"` }
Output contains options to persist job output
func (*Output) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Output.
type Strategy ¶
type Strategy string
Strategy describes the trigger strategy
const ( // TriggerManual is the default for errand jobs, change to TriggerNow to run them TriggerManual Strategy = "manual" // TriggerNow instructs the controller to run the job now, // resets to TriggerManual after starting the job TriggerNow Strategy = "now" // TriggerOnce jobs run only once, when created, then switches to TriggerDone TriggerOnce Strategy = "once" // TriggerDone jobs are no longer triggered. It's the final state for TriggerOnce strategies TriggerDone Strategy = "done" )