batch: add suspended job

Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>

Kubernetes-commit: a0844da8f799e6f360193ecfd02c84d61a62958b
This commit is contained in:
Adhityaa Chandrasekar 2021-03-08 11:50:02 +00:00 committed by Kubernetes Publisher
parent aa6ddc8e87
commit 5ca42dac08

View File

@ -36,6 +36,7 @@ type JobSpecApplyConfiguration struct {
Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"`
TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"` TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`
CompletionMode *batchv1.CompletionMode `json:"completionMode,omitempty"` CompletionMode *batchv1.CompletionMode `json:"completionMode,omitempty"`
Suspend *bool `json:"suspend,omitempty"`
} }
// JobSpecApplyConfiguration constructs an declarative configuration of the JobSpec type for use with // JobSpecApplyConfiguration constructs an declarative configuration of the JobSpec type for use with
@ -115,3 +116,11 @@ func (b *JobSpecApplyConfiguration) WithCompletionMode(value batchv1.CompletionM
b.CompletionMode = &value b.CompletionMode = &value
return b return b
} }
// WithSuspend sets the Suspend field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Suspend field is set to the value of the last call.
func (b *JobSpecApplyConfiguration) WithSuspend(value bool) *JobSpecApplyConfiguration {
b.Suspend = &value
return b
}