From 70917217eee4df33cf88865af7ead47fbed010d8 Mon Sep 17 00:00:00 2001 From: kannon92 Date: Tue, 18 Jul 2023 17:25:15 +0000 Subject: [PATCH] add podReplacementPolicy and terminating field to job api Kubernetes-commit: ce929520376417a9358067ad8576b10e734cb7a9 --- applyconfigurations/batch/v1/jobspec.go | 9 +++++++++ applyconfigurations/batch/v1/jobstatus.go | 9 +++++++++ applyconfigurations/internal/internal.go | 6 ++++++ 3 files changed, 24 insertions(+) diff --git a/applyconfigurations/batch/v1/jobspec.go b/applyconfigurations/batch/v1/jobspec.go index b94aa966..3d46a3ec 100644 --- a/applyconfigurations/batch/v1/jobspec.go +++ b/applyconfigurations/batch/v1/jobspec.go @@ -40,6 +40,7 @@ type JobSpecApplyConfiguration struct { TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"` CompletionMode *batchv1.CompletionMode `json:"completionMode,omitempty"` Suspend *bool `json:"suspend,omitempty"` + PodReplacementPolicy *batchv1.PodReplacementPolicy `json:"podReplacementPolicy,omitempty"` } // JobSpecApplyConfiguration constructs an declarative configuration of the JobSpec type for use with @@ -151,3 +152,11 @@ func (b *JobSpecApplyConfiguration) WithSuspend(value bool) *JobSpecApplyConfigu b.Suspend = &value return b } + +// WithPodReplacementPolicy sets the PodReplacementPolicy 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 PodReplacementPolicy field is set to the value of the last call. +func (b *JobSpecApplyConfiguration) WithPodReplacementPolicy(value batchv1.PodReplacementPolicy) *JobSpecApplyConfiguration { + b.PodReplacementPolicy = &value + return b +} diff --git a/applyconfigurations/batch/v1/jobstatus.go b/applyconfigurations/batch/v1/jobstatus.go index a9294e4d..e8e472f8 100644 --- a/applyconfigurations/batch/v1/jobstatus.go +++ b/applyconfigurations/batch/v1/jobstatus.go @@ -31,6 +31,7 @@ type JobStatusApplyConfiguration struct { Active *int32 `json:"active,omitempty"` Succeeded *int32 `json:"succeeded,omitempty"` Failed *int32 `json:"failed,omitempty"` + Terminating *int32 `json:"terminating,omitempty"` CompletedIndexes *string `json:"completedIndexes,omitempty"` FailedIndexes *string `json:"failedIndexes,omitempty"` UncountedTerminatedPods *UncountedTerminatedPodsApplyConfiguration `json:"uncountedTerminatedPods,omitempty"` @@ -96,6 +97,14 @@ func (b *JobStatusApplyConfiguration) WithFailed(value int32) *JobStatusApplyCon return b } +// WithTerminating sets the Terminating 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 Terminating field is set to the value of the last call. +func (b *JobStatusApplyConfiguration) WithTerminating(value int32) *JobStatusApplyConfiguration { + b.Terminating = &value + return b +} + // WithCompletedIndexes sets the CompletedIndexes 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 CompletedIndexes field is set to the value of the last call. diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 5ce4fbf3..b82d5a7e 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -3374,6 +3374,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: podFailurePolicy type: namedType: io.k8s.api.batch.v1.PodFailurePolicy + - name: podReplacementPolicy + type: + scalar: string - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector @@ -3420,6 +3423,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: succeeded type: scalar: numeric + - name: terminating + type: + scalar: numeric - name: uncountedTerminatedPods type: namedType: io.k8s.api.batch.v1.UncountedTerminatedPods