Debian Codegraph @

applyconfigurations/core/v1/podspec.go

raw
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 corev1 "k8s.io/api/core/v1"
23 )
24
25 // PodSpecApplyConfiguration represents a declarative configuration of the PodSpec type for use
26 // with apply.
27 type PodSpecApplyConfiguration struct {
28 Volumes []VolumeApplyConfiguration `json:"volumes,omitempty"`
29 InitContainers []ContainerApplyConfiguration `json:"initContainers,omitempty"`
30 Containers []ContainerApplyConfiguration `json:"containers,omitempty"`
31 EphemeralContainers []EphemeralContainerApplyConfiguration `json:"ephemeralContainers,omitempty"`
32 RestartPolicy *corev1.RestartPolicy `json:"restartPolicy,omitempty"`
33 TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
34 ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
35 DNSPolicy *corev1.DNSPolicy `json:"dnsPolicy,omitempty"`
36 NodeSelector map[string]string `json:"nodeSelector,omitempty"`
37 ServiceAccountName *string `json:"serviceAccountName,omitempty"`
38 DeprecatedServiceAccount *string `json:"serviceAccount,omitempty"`
39 AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"`
40 NodeName *string `json:"nodeName,omitempty"`
41 HostNetwork *bool `json:"hostNetwork,omitempty"`
42 HostPID *bool `json:"hostPID,omitempty"`
43 HostIPC *bool `json:"hostIPC,omitempty"`
44 ShareProcessNamespace *bool `json:"shareProcessNamespace,omitempty"`
45 SecurityContext *PodSecurityContextApplyConfiguration `json:"securityContext,omitempty"`
46 ImagePullSecrets []LocalObjectReferenceApplyConfiguration `json:"imagePullSecrets,omitempty"`
47 Hostname *string `json:"hostname,omitempty"`
48 Subdomain *string `json:"subdomain,omitempty"`
49 Affinity *AffinityApplyConfiguration `json:"affinity,omitempty"`
50 SchedulerName *string `json:"schedulerName,omitempty"`
51 Tolerations []TolerationApplyConfiguration `json:"tolerations,omitempty"`
52 HostAliases []HostAliasApplyConfiguration `json:"hostAliases,omitempty"`
53 PriorityClassName *string `json:"priorityClassName,omitempty"`
54 Priority *int32 `json:"priority,omitempty"`
55 DNSConfig *PodDNSConfigApplyConfiguration `json:"dnsConfig,omitempty"`
56 ReadinessGates []PodReadinessGateApplyConfiguration `json:"readinessGates,omitempty"`
57 RuntimeClassName *string `json:"runtimeClassName,omitempty"`
58 EnableServiceLinks *bool `json:"enableServiceLinks,omitempty"`
59 PreemptionPolicy *corev1.PreemptionPolicy `json:"preemptionPolicy,omitempty"`
60 Overhead *corev1.ResourceList `json:"overhead,omitempty"`
61 TopologySpreadConstraints []TopologySpreadConstraintApplyConfiguration `json:"topologySpreadConstraints,omitempty"`
62 SetHostnameAsFQDN *bool `json:"setHostnameAsFQDN,omitempty"`
63 OS *PodOSApplyConfiguration `json:"os,omitempty"`
64 HostUsers *bool `json:"hostUsers,omitempty"`
65 SchedulingGates []PodSchedulingGateApplyConfiguration `json:"schedulingGates,omitempty"`
66 ResourceClaims []PodResourceClaimApplyConfiguration `json:"resourceClaims,omitempty"`
67 Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"`
68 }
69
70 // PodSpecApplyConfiguration constructs a declarative configuration of the PodSpec type for use with
71 // apply.
72 func PodSpec() *PodSpecApplyConfiguration {
73 return &PodSpecApplyConfiguration{}
74 }
75
76 // WithVolumes adds the given value to the Volumes field in the declarative configuration
77 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
78 // If called multiple times, values provided by each call will be appended to the Volumes field.
79 func (b *PodSpecApplyConfiguration) WithVolumes(values ...*VolumeApplyConfiguration) *PodSpecApplyConfiguration {
80 for i := range values {
81 if values[i] == nil {
82 panic("nil value passed to WithVolumes")
83 }
84 b.Volumes = append(b.Volumes, *values[i])
85 }
86 return b
87 }
88
89 // WithInitContainers adds the given value to the InitContainers field in the declarative configuration
90 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
91 // If called multiple times, values provided by each call will be appended to the InitContainers field.
92 func (b *PodSpecApplyConfiguration) WithInitContainers(values ...*ContainerApplyConfiguration) *PodSpecApplyConfiguration {
93 for i := range values {
94 if values[i] == nil {
95 panic("nil value passed to WithInitContainers")
96 }
97 b.InitContainers = append(b.InitContainers, *values[i])
98 }
99 return b
100 }
101
102 // WithContainers adds the given value to the Containers field in the declarative configuration
103 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
104 // If called multiple times, values provided by each call will be appended to the Containers field.
105 func (b *PodSpecApplyConfiguration) WithContainers(values ...*ContainerApplyConfiguration) *PodSpecApplyConfiguration {
106 for i := range values {
107 if values[i] == nil {
108 panic("nil value passed to WithContainers")
109 }
110 b.Containers = append(b.Containers, *values[i])
111 }
112 return b
113 }
114
115 // WithEphemeralContainers adds the given value to the EphemeralContainers field in the declarative configuration
116 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
117 // If called multiple times, values provided by each call will be appended to the EphemeralContainers field.
118 func (b *PodSpecApplyConfiguration) WithEphemeralContainers(values ...*EphemeralContainerApplyConfiguration) *PodSpecApplyConfiguration {
119 for i := range values {
120 if values[i] == nil {
121 panic("nil value passed to WithEphemeralContainers")
122 }
123 b.EphemeralContainers = append(b.EphemeralContainers, *values[i])
124 }
125 return b
126 }
127
128 // WithRestartPolicy sets the RestartPolicy field in the declarative configuration to the given value
129 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
130 // If called multiple times, the RestartPolicy field is set to the value of the last call.
131 func (b *PodSpecApplyConfiguration) WithRestartPolicy(value corev1.RestartPolicy) *PodSpecApplyConfiguration {
132 b.RestartPolicy = &value
133 return b
134 }
135
136 // WithTerminationGracePeriodSeconds sets the TerminationGracePeriodSeconds field in the declarative configuration to the given value
137 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
138 // If called multiple times, the TerminationGracePeriodSeconds field is set to the value of the last call.
139 func (b *PodSpecApplyConfiguration) WithTerminationGracePeriodSeconds(value int64) *PodSpecApplyConfiguration {
140 b.TerminationGracePeriodSeconds = &value
141 return b
142 }
143
144 // WithActiveDeadlineSeconds sets the ActiveDeadlineSeconds field in the declarative configuration to the given value
145 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
146 // If called multiple times, the ActiveDeadlineSeconds field is set to the value of the last call.
147 func (b *PodSpecApplyConfiguration) WithActiveDeadlineSeconds(value int64) *PodSpecApplyConfiguration {
148 b.ActiveDeadlineSeconds = &value
149 return b
150 }
151
152 // WithDNSPolicy sets the DNSPolicy field in the declarative configuration to the given value
153 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
154 // If called multiple times, the DNSPolicy field is set to the value of the last call.
155 func (b *PodSpecApplyConfiguration) WithDNSPolicy(value corev1.DNSPolicy) *PodSpecApplyConfiguration {
156 b.DNSPolicy = &value
157 return b
158 }
159
160 // WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration
161 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
162 // If called multiple times, the entries provided by each call will be put on the NodeSelector field,
163 // overwriting an existing map entries in NodeSelector field with the same key.
164 func (b *PodSpecApplyConfiguration) WithNodeSelector(entries map[string]string) *PodSpecApplyConfiguration {
165 if b.NodeSelector == nil && len(entries) > 0 {
166 b.NodeSelector = make(map[string]string, len(entries))
167 }
168 for k, v := range entries {
169 b.NodeSelector[k] = v
170 }
171 return b
172 }
173
174 // WithServiceAccountName sets the ServiceAccountName 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 ServiceAccountName field is set to the value of the last call.
177 func (b *PodSpecApplyConfiguration) WithServiceAccountName(value string) *PodSpecApplyConfiguration {
178 b.ServiceAccountName = &value
179 return b
180 }
181
182 // WithDeprecatedServiceAccount sets the DeprecatedServiceAccount field in the declarative configuration to the given value
183 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
184 // If called multiple times, the DeprecatedServiceAccount field is set to the value of the last call.
185 func (b *PodSpecApplyConfiguration) WithDeprecatedServiceAccount(value string) *PodSpecApplyConfiguration {
186 b.DeprecatedServiceAccount = &value
187 return b
188 }
189
190 // WithAutomountServiceAccountToken sets the AutomountServiceAccountToken field in the declarative configuration to the given value
191 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
192 // If called multiple times, the AutomountServiceAccountToken field is set to the value of the last call.
193 func (b *PodSpecApplyConfiguration) WithAutomountServiceAccountToken(value bool) *PodSpecApplyConfiguration {
194 b.AutomountServiceAccountToken = &value
195 return b
196 }
197
198 // WithNodeName sets the NodeName field in the declarative configuration to the given value
199 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
200 // If called multiple times, the NodeName field is set to the value of the last call.
201 func (b *PodSpecApplyConfiguration) WithNodeName(value string) *PodSpecApplyConfiguration {
202 b.NodeName = &value
203 return b
204 }
205
206 // WithHostNetwork sets the HostNetwork field in the declarative configuration to the given value
207 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
208 // If called multiple times, the HostNetwork field is set to the value of the last call.
209 func (b *PodSpecApplyConfiguration) WithHostNetwork(value bool) *PodSpecApplyConfiguration {
210 b.HostNetwork = &value
211 return b
212 }
213
214 // WithHostPID sets the HostPID field in the declarative configuration to the given value
215 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
216 // If called multiple times, the HostPID field is set to the value of the last call.
217 func (b *PodSpecApplyConfiguration) WithHostPID(value bool) *PodSpecApplyConfiguration {
218 b.HostPID = &value
219 return b
220 }
221
222 // WithHostIPC sets the HostIPC field in the declarative configuration to the given value
223 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
224 // If called multiple times, the HostIPC field is set to the value of the last call.
225 func (b *PodSpecApplyConfiguration) WithHostIPC(value bool) *PodSpecApplyConfiguration {
226 b.HostIPC = &value
227 return b
228 }
229
230 // WithShareProcessNamespace sets the ShareProcessNamespace field in the declarative configuration to the given value
231 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
232 // If called multiple times, the ShareProcessNamespace field is set to the value of the last call.
233 func (b *PodSpecApplyConfiguration) WithShareProcessNamespace(value bool) *PodSpecApplyConfiguration {
234 b.ShareProcessNamespace = &value
235 return b
236 }
237
238 // WithSecurityContext sets the SecurityContext field in the declarative configuration to the given value
239 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
240 // If called multiple times, the SecurityContext field is set to the value of the last call.
241 func (b *PodSpecApplyConfiguration) WithSecurityContext(value *PodSecurityContextApplyConfiguration) *PodSpecApplyConfiguration {
242 b.SecurityContext = value
243 return b
244 }
245
246 // WithImagePullSecrets adds the given value to the ImagePullSecrets field in the declarative configuration
247 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
248 // If called multiple times, values provided by each call will be appended to the ImagePullSecrets field.
249 func (b *PodSpecApplyConfiguration) WithImagePullSecrets(values ...*LocalObjectReferenceApplyConfiguration) *PodSpecApplyConfiguration {
250 for i := range values {
251 if values[i] == nil {
252 panic("nil value passed to WithImagePullSecrets")
253 }
254 b.ImagePullSecrets = append(b.ImagePullSecrets, *values[i])
255 }
256 return b
257 }
258
259 // WithHostname sets the Hostname field in the declarative configuration to the given value
260 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
261 // If called multiple times, the Hostname field is set to the value of the last call.
262 func (b *PodSpecApplyConfiguration) WithHostname(value string) *PodSpecApplyConfiguration {
263 b.Hostname = &value
264 return b
265 }
266
267 // WithSubdomain sets the Subdomain field in the declarative configuration to the given value
268 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
269 // If called multiple times, the Subdomain field is set to the value of the last call.
270 func (b *PodSpecApplyConfiguration) WithSubdomain(value string) *PodSpecApplyConfiguration {
271 b.Subdomain = &value
272 return b
273 }
274
275 // WithAffinity sets the Affinity field in the declarative configuration to the given value
276 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
277 // If called multiple times, the Affinity field is set to the value of the last call.
278 func (b *PodSpecApplyConfiguration) WithAffinity(value *AffinityApplyConfiguration) *PodSpecApplyConfiguration {
279 b.Affinity = value
280 return b
281 }
282
283 // WithSchedulerName sets the SchedulerName field in the declarative configuration to the given value
284 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
285 // If called multiple times, the SchedulerName field is set to the value of the last call.
286 func (b *PodSpecApplyConfiguration) WithSchedulerName(value string) *PodSpecApplyConfiguration {
287 b.SchedulerName = &value
288 return b
289 }
290
291 // WithTolerations adds the given value to the Tolerations field in the declarative configuration
292 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
293 // If called multiple times, values provided by each call will be appended to the Tolerations field.
294 func (b *PodSpecApplyConfiguration) WithTolerations(values ...*TolerationApplyConfiguration) *PodSpecApplyConfiguration {
295 for i := range values {
296 if values[i] == nil {
297 panic("nil value passed to WithTolerations")
298 }
299 b.Tolerations = append(b.Tolerations, *values[i])
300 }
301 return b
302 }
303
304 // WithHostAliases adds the given value to the HostAliases field in the declarative configuration
305 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
306 // If called multiple times, values provided by each call will be appended to the HostAliases field.
307 func (b *PodSpecApplyConfiguration) WithHostAliases(values ...*HostAliasApplyConfiguration) *PodSpecApplyConfiguration {
308 for i := range values {
309 if values[i] == nil {
310 panic("nil value passed to WithHostAliases")
311 }
312 b.HostAliases = append(b.HostAliases, *values[i])
313 }
314 return b
315 }
316
317 // WithPriorityClassName sets the PriorityClassName field in the declarative configuration to the given value
318 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
319 // If called multiple times, the PriorityClassName field is set to the value of the last call.
320 func (b *PodSpecApplyConfiguration) WithPriorityClassName(value string) *PodSpecApplyConfiguration {
321 b.PriorityClassName = &value
322 return b
323 }
324
325 // WithPriority sets the Priority field in the declarative configuration to the given value
326 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
327 // If called multiple times, the Priority field is set to the value of the last call.
328 func (b *PodSpecApplyConfiguration) WithPriority(value int32) *PodSpecApplyConfiguration {
329 b.Priority = &value
330 return b
331 }
332
333 // WithDNSConfig sets the DNSConfig field in the declarative configuration to the given value
334 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
335 // If called multiple times, the DNSConfig field is set to the value of the last call.
336 func (b *PodSpecApplyConfiguration) WithDNSConfig(value *PodDNSConfigApplyConfiguration) *PodSpecApplyConfiguration {
337 b.DNSConfig = value
338 return b
339 }
340
341 // WithReadinessGates adds the given value to the ReadinessGates field in the declarative configuration
342 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
343 // If called multiple times, values provided by each call will be appended to the ReadinessGates field.
344 func (b *PodSpecApplyConfiguration) WithReadinessGates(values ...*PodReadinessGateApplyConfiguration) *PodSpecApplyConfiguration {
345 for i := range values {
346 if values[i] == nil {
347 panic("nil value passed to WithReadinessGates")
348 }
349 b.ReadinessGates = append(b.ReadinessGates, *values[i])
350 }
351 return b
352 }
353
354 // WithRuntimeClassName sets the RuntimeClassName field in the declarative configuration to the given value
355 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
356 // If called multiple times, the RuntimeClassName field is set to the value of the last call.
357 func (b *PodSpecApplyConfiguration) WithRuntimeClassName(value string) *PodSpecApplyConfiguration {
358 b.RuntimeClassName = &value
359 return b
360 }
361
362 // WithEnableServiceLinks sets the EnableServiceLinks field in the declarative configuration to the given value
363 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
364 // If called multiple times, the EnableServiceLinks field is set to the value of the last call.
365 func (b *PodSpecApplyConfiguration) WithEnableServiceLinks(value bool) *PodSpecApplyConfiguration {
366 b.EnableServiceLinks = &value
367 return b
368 }
369
370 // WithPreemptionPolicy sets the PreemptionPolicy field in the declarative configuration to the given value
371 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
372 // If called multiple times, the PreemptionPolicy field is set to the value of the last call.
373 func (b *PodSpecApplyConfiguration) WithPreemptionPolicy(value corev1.PreemptionPolicy) *PodSpecApplyConfiguration {
374 b.PreemptionPolicy = &value
375 return b
376 }
377
378 // WithOverhead sets the Overhead field in the declarative configuration to the given value
379 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
380 // If called multiple times, the Overhead field is set to the value of the last call.
381 func (b *PodSpecApplyConfiguration) WithOverhead(value corev1.ResourceList) *PodSpecApplyConfiguration {
382 b.Overhead = &value
383 return b
384 }
385
386 // WithTopologySpreadConstraints adds the given value to the TopologySpreadConstraints field in the declarative configuration
387 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
388 // If called multiple times, values provided by each call will be appended to the TopologySpreadConstraints field.
389 func (b *PodSpecApplyConfiguration) WithTopologySpreadConstraints(values ...*TopologySpreadConstraintApplyConfiguration) *PodSpecApplyConfiguration {
390 for i := range values {
391 if values[i] == nil {
392 panic("nil value passed to WithTopologySpreadConstraints")
393 }
394 b.TopologySpreadConstraints = append(b.TopologySpreadConstraints, *values[i])
395 }
396 return b
397 }
398
399 // WithSetHostnameAsFQDN sets the SetHostnameAsFQDN field in the declarative configuration to the given value
400 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
401 // If called multiple times, the SetHostnameAsFQDN field is set to the value of the last call.
402 func (b *PodSpecApplyConfiguration) WithSetHostnameAsFQDN(value bool) *PodSpecApplyConfiguration {
403 b.SetHostnameAsFQDN = &value
404 return b
405 }
406
407 // WithOS sets the OS field in the declarative configuration to the given value
408 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
409 // If called multiple times, the OS field is set to the value of the last call.
410 func (b *PodSpecApplyConfiguration) WithOS(value *PodOSApplyConfiguration) *PodSpecApplyConfiguration {
411 b.OS = value
412 return b
413 }
414
415 // WithHostUsers sets the HostUsers field in the declarative configuration to the given value
416 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
417 // If called multiple times, the HostUsers field is set to the value of the last call.
418 func (b *PodSpecApplyConfiguration) WithHostUsers(value bool) *PodSpecApplyConfiguration {
419 b.HostUsers = &value
420 return b
421 }
422
423 // WithSchedulingGates adds the given value to the SchedulingGates field in the declarative configuration
424 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
425 // If called multiple times, values provided by each call will be appended to the SchedulingGates field.
426 func (b *PodSpecApplyConfiguration) WithSchedulingGates(values ...*PodSchedulingGateApplyConfiguration) *PodSpecApplyConfiguration {
427 for i := range values {
428 if values[i] == nil {
429 panic("nil value passed to WithSchedulingGates")
430 }
431 b.SchedulingGates = append(b.SchedulingGates, *values[i])
432 }
433 return b
434 }
435
436 // WithResourceClaims adds the given value to the ResourceClaims field in the declarative configuration
437 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
438 // If called multiple times, values provided by each call will be appended to the ResourceClaims field.
439 func (b *PodSpecApplyConfiguration) WithResourceClaims(values ...*PodResourceClaimApplyConfiguration) *PodSpecApplyConfiguration {
440 for i := range values {
441 if values[i] == nil {
442 panic("nil value passed to WithResourceClaims")
443 }
444 b.ResourceClaims = append(b.ResourceClaims, *values[i])
445 }
446 return b
447 }
448
449 // WithResources sets the Resources field in the declarative configuration to the given value
450 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
451 // If called multiple times, the Resources field is set to the value of the last call.
452 func (b *PodSpecApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *PodSpecApplyConfiguration {
453 b.Resources = value
454 return b
455 }