k8s.io/client-go@v0.31.1/applyconfigurations/batch/v1/jobspec.go (about) 1 /* 2 Copyright The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 19 package v1 20 21 import ( 22 batchv1 "k8s.io/api/batch/v1" 23 corev1 "k8s.io/client-go/applyconfigurations/core/v1" 24 metav1 "k8s.io/client-go/applyconfigurations/meta/v1" 25 ) 26 27 // JobSpecApplyConfiguration represents a declarative configuration of the JobSpec type for use 28 // with apply. 29 type JobSpecApplyConfiguration struct { 30 Parallelism *int32 `json:"parallelism,omitempty"` 31 Completions *int32 `json:"completions,omitempty"` 32 ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` 33 PodFailurePolicy *PodFailurePolicyApplyConfiguration `json:"podFailurePolicy,omitempty"` 34 SuccessPolicy *SuccessPolicyApplyConfiguration `json:"successPolicy,omitempty"` 35 BackoffLimit *int32 `json:"backoffLimit,omitempty"` 36 BackoffLimitPerIndex *int32 `json:"backoffLimitPerIndex,omitempty"` 37 MaxFailedIndexes *int32 `json:"maxFailedIndexes,omitempty"` 38 Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` 39 ManualSelector *bool `json:"manualSelector,omitempty"` 40 Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` 41 TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"` 42 CompletionMode *batchv1.CompletionMode `json:"completionMode,omitempty"` 43 Suspend *bool `json:"suspend,omitempty"` 44 PodReplacementPolicy *batchv1.PodReplacementPolicy `json:"podReplacementPolicy,omitempty"` 45 ManagedBy *string `json:"managedBy,omitempty"` 46 } 47 48 // JobSpecApplyConfiguration constructs a declarative configuration of the JobSpec type for use with 49 // apply. 50 func JobSpec() *JobSpecApplyConfiguration { 51 return &JobSpecApplyConfiguration{} 52 } 53 54 // WithParallelism sets the Parallelism field in the declarative configuration to the given value 55 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 56 // If called multiple times, the Parallelism field is set to the value of the last call. 57 func (b *JobSpecApplyConfiguration) WithParallelism(value int32) *JobSpecApplyConfiguration { 58 b.Parallelism = &value 59 return b 60 } 61 62 // WithCompletions sets the Completions field in the declarative configuration to the given value 63 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 64 // If called multiple times, the Completions field is set to the value of the last call. 65 func (b *JobSpecApplyConfiguration) WithCompletions(value int32) *JobSpecApplyConfiguration { 66 b.Completions = &value 67 return b 68 } 69 70 // WithActiveDeadlineSeconds sets the ActiveDeadlineSeconds field in the declarative configuration to the given value 71 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 72 // If called multiple times, the ActiveDeadlineSeconds field is set to the value of the last call. 73 func (b *JobSpecApplyConfiguration) WithActiveDeadlineSeconds(value int64) *JobSpecApplyConfiguration { 74 b.ActiveDeadlineSeconds = &value 75 return b 76 } 77 78 // WithPodFailurePolicy sets the PodFailurePolicy field in the declarative configuration to the given value 79 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 80 // If called multiple times, the PodFailurePolicy field is set to the value of the last call. 81 func (b *JobSpecApplyConfiguration) WithPodFailurePolicy(value *PodFailurePolicyApplyConfiguration) *JobSpecApplyConfiguration { 82 b.PodFailurePolicy = value 83 return b 84 } 85 86 // WithSuccessPolicy sets the SuccessPolicy field in the declarative configuration to the given value 87 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 88 // If called multiple times, the SuccessPolicy field is set to the value of the last call. 89 func (b *JobSpecApplyConfiguration) WithSuccessPolicy(value *SuccessPolicyApplyConfiguration) *JobSpecApplyConfiguration { 90 b.SuccessPolicy = value 91 return b 92 } 93 94 // WithBackoffLimit sets the BackoffLimit field in the declarative configuration to the given value 95 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 96 // If called multiple times, the BackoffLimit field is set to the value of the last call. 97 func (b *JobSpecApplyConfiguration) WithBackoffLimit(value int32) *JobSpecApplyConfiguration { 98 b.BackoffLimit = &value 99 return b 100 } 101 102 // WithBackoffLimitPerIndex sets the BackoffLimitPerIndex field in the declarative configuration to the given value 103 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 104 // If called multiple times, the BackoffLimitPerIndex field is set to the value of the last call. 105 func (b *JobSpecApplyConfiguration) WithBackoffLimitPerIndex(value int32) *JobSpecApplyConfiguration { 106 b.BackoffLimitPerIndex = &value 107 return b 108 } 109 110 // WithMaxFailedIndexes sets the MaxFailedIndexes field in the declarative configuration to the given value 111 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 112 // If called multiple times, the MaxFailedIndexes field is set to the value of the last call. 113 func (b *JobSpecApplyConfiguration) WithMaxFailedIndexes(value int32) *JobSpecApplyConfiguration { 114 b.MaxFailedIndexes = &value 115 return b 116 } 117 118 // WithSelector sets the Selector field in the declarative configuration to the given value 119 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 120 // If called multiple times, the Selector field is set to the value of the last call. 121 func (b *JobSpecApplyConfiguration) WithSelector(value *metav1.LabelSelectorApplyConfiguration) *JobSpecApplyConfiguration { 122 b.Selector = value 123 return b 124 } 125 126 // WithManualSelector sets the ManualSelector field in the declarative configuration to the given value 127 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 128 // If called multiple times, the ManualSelector field is set to the value of the last call. 129 func (b *JobSpecApplyConfiguration) WithManualSelector(value bool) *JobSpecApplyConfiguration { 130 b.ManualSelector = &value 131 return b 132 } 133 134 // WithTemplate sets the Template field in the declarative configuration to the given value 135 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 136 // If called multiple times, the Template field is set to the value of the last call. 137 func (b *JobSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *JobSpecApplyConfiguration { 138 b.Template = value 139 return b 140 } 141 142 // WithTTLSecondsAfterFinished sets the TTLSecondsAfterFinished field in the declarative configuration to the given value 143 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 144 // If called multiple times, the TTLSecondsAfterFinished field is set to the value of the last call. 145 func (b *JobSpecApplyConfiguration) WithTTLSecondsAfterFinished(value int32) *JobSpecApplyConfiguration { 146 b.TTLSecondsAfterFinished = &value 147 return b 148 } 149 150 // WithCompletionMode sets the CompletionMode field in the declarative configuration to the given value 151 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 152 // If called multiple times, the CompletionMode field is set to the value of the last call. 153 func (b *JobSpecApplyConfiguration) WithCompletionMode(value batchv1.CompletionMode) *JobSpecApplyConfiguration { 154 b.CompletionMode = &value 155 return b 156 } 157 158 // WithSuspend sets the Suspend field in the declarative configuration to the given value 159 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 160 // If called multiple times, the Suspend field is set to the value of the last call. 161 func (b *JobSpecApplyConfiguration) WithSuspend(value bool) *JobSpecApplyConfiguration { 162 b.Suspend = &value 163 return b 164 } 165 166 // WithPodReplacementPolicy sets the PodReplacementPolicy field in the declarative configuration to the given value 167 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 168 // If called multiple times, the PodReplacementPolicy field is set to the value of the last call. 169 func (b *JobSpecApplyConfiguration) WithPodReplacementPolicy(value batchv1.PodReplacementPolicy) *JobSpecApplyConfiguration { 170 b.PodReplacementPolicy = &value 171 return b 172 } 173 174 // WithManagedBy sets the ManagedBy field in the declarative configuration to the given value 175 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 176 // If called multiple times, the ManagedBy field is set to the value of the last call. 177 func (b *JobSpecApplyConfiguration) WithManagedBy(value string) *JobSpecApplyConfiguration { 178 b.ManagedBy = &value 179 return b 180 }