From 5ca42dac08480be3024fd78847752f926a843525 Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Mon, 8 Mar 2021 11:50:02 +0000 Subject: [PATCH] batch: add suspended job Signed-off-by: Adhityaa Chandrasekar Kubernetes-commit: a0844da8f799e6f360193ecfd02c84d61a62958b --- applyconfigurations/batch/v1/jobspec.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/applyconfigurations/batch/v1/jobspec.go b/applyconfigurations/batch/v1/jobspec.go index f9a79f9d..e1424488 100644 --- a/applyconfigurations/batch/v1/jobspec.go +++ b/applyconfigurations/batch/v1/jobspec.go @@ -36,6 +36,7 @@ type JobSpecApplyConfiguration struct { Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"` CompletionMode *batchv1.CompletionMode `json:"completionMode,omitempty"` + Suspend *bool `json:"suspend,omitempty"` } // 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 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 +}