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 // ContainerApplyConfiguration represents an declarative configuration of the Container type for use 26 // with apply. 27 type ContainerApplyConfiguration struct { 28 Name *string `json:"name,omitempty"` 29 Image *string `json:"image,omitempty"` 30 Command []string `json:"command,omitempty"` 31 Args []string `json:"args,omitempty"` 32 WorkingDir *string `json:"workingDir,omitempty"` 33 Ports []ContainerPortApplyConfiguration `json:"ports,omitempty"` 34 EnvFrom []EnvFromSourceApplyConfiguration `json:"envFrom,omitempty"` 35 Env []EnvVarApplyConfiguration `json:"env,omitempty"` 36 Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` 37 ResizePolicy []ContainerResizePolicyApplyConfiguration `json:"resizePolicy,omitempty"` 38 RestartPolicy *corev1.ContainerRestartPolicy `json:"restartPolicy,omitempty"` 39 VolumeMounts []VolumeMountApplyConfiguration `json:"volumeMounts,omitempty"` 40 VolumeDevices []VolumeDeviceApplyConfiguration `json:"volumeDevices,omitempty"` 41 LivenessProbe *ProbeApplyConfiguration `json:"livenessProbe,omitempty"` 42 ReadinessProbe *ProbeApplyConfiguration `json:"readinessProbe,omitempty"` 43 StartupProbe *ProbeApplyConfiguration `json:"startupProbe,omitempty"` 44 Lifecycle *LifecycleApplyConfiguration `json:"lifecycle,omitempty"` 45 TerminationMessagePath *string `json:"terminationMessagePath,omitempty"` 46 TerminationMessagePolicy *corev1.TerminationMessagePolicy `json:"terminationMessagePolicy,omitempty"` 47 ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"` 48 SecurityContext *SecurityContextApplyConfiguration `json:"securityContext,omitempty"` 49 Stdin *bool `json:"stdin,omitempty"` 50 StdinOnce *bool `json:"stdinOnce,omitempty"` 51 TTY *bool `json:"tty,omitempty"` 52 } 53 54 // ContainerApplyConfiguration constructs an declarative configuration of the Container type for use with 55 // apply. 56 func Container() *ContainerApplyConfiguration { 57 return &ContainerApplyConfiguration{} 58 } 59 60 // WithName sets the Name field in the declarative configuration to the given value 61 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 62 // If called multiple times, the Name field is set to the value of the last call. 63 func (b *ContainerApplyConfiguration) WithName(value string) *ContainerApplyConfiguration { 64 b.Name = &value 65 return b 66 } 67 68 // WithImage sets the Image field in the declarative configuration to the given value 69 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 70 // If called multiple times, the Image field is set to the value of the last call. 71 func (b *ContainerApplyConfiguration) WithImage(value string) *ContainerApplyConfiguration { 72 b.Image = &value 73 return b 74 } 75 76 // WithCommand adds the given value to the Command 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 Command field. 79 func (b *ContainerApplyConfiguration) WithCommand(values ...string) *ContainerApplyConfiguration { 80 for i := range values { 81 b.Command = append(b.Command, values[i]) 82 } 83 return b 84 } 85 86 // WithArgs adds the given value to the Args field in the declarative configuration 87 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 88 // If called multiple times, values provided by each call will be appended to the Args field. 89 func (b *ContainerApplyConfiguration) WithArgs(values ...string) *ContainerApplyConfiguration { 90 for i := range values { 91 b.Args = append(b.Args, values[i]) 92 } 93 return b 94 } 95 96 // WithWorkingDir sets the WorkingDir field in the declarative configuration to the given value 97 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 98 // If called multiple times, the WorkingDir field is set to the value of the last call. 99 func (b *ContainerApplyConfiguration) WithWorkingDir(value string) *ContainerApplyConfiguration { 100 b.WorkingDir = &value 101 return b 102 } 103 104 // WithPorts adds the given value to the Ports field in the declarative configuration 105 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 106 // If called multiple times, values provided by each call will be appended to the Ports field. 107 func (b *ContainerApplyConfiguration) WithPorts(values ...*ContainerPortApplyConfiguration) *ContainerApplyConfiguration { 108 for i := range values { 109 if values[i] == nil { 110 panic("nil value passed to WithPorts") 111 } 112 b.Ports = append(b.Ports, *values[i]) 113 } 114 return b 115 } 116 117 // WithEnvFrom adds the given value to the EnvFrom field in the declarative configuration 118 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 119 // If called multiple times, values provided by each call will be appended to the EnvFrom field. 120 func (b *ContainerApplyConfiguration) WithEnvFrom(values ...*EnvFromSourceApplyConfiguration) *ContainerApplyConfiguration { 121 for i := range values { 122 if values[i] == nil { 123 panic("nil value passed to WithEnvFrom") 124 } 125 b.EnvFrom = append(b.EnvFrom, *values[i]) 126 } 127 return b 128 } 129 130 // WithEnv adds the given value to the Env field in the declarative configuration 131 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 132 // If called multiple times, values provided by each call will be appended to the Env field. 133 func (b *ContainerApplyConfiguration) WithEnv(values ...*EnvVarApplyConfiguration) *ContainerApplyConfiguration { 134 for i := range values { 135 if values[i] == nil { 136 panic("nil value passed to WithEnv") 137 } 138 b.Env = append(b.Env, *values[i]) 139 } 140 return b 141 } 142 143 // WithResources sets the Resources field in the declarative configuration to the given value 144 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 145 // If called multiple times, the Resources field is set to the value of the last call. 146 func (b *ContainerApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *ContainerApplyConfiguration { 147 b.Resources = value 148 return b 149 } 150 151 // WithResizePolicy adds the given value to the ResizePolicy field in the declarative configuration 152 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 153 // If called multiple times, values provided by each call will be appended to the ResizePolicy field. 154 func (b *ContainerApplyConfiguration) WithResizePolicy(values ...*ContainerResizePolicyApplyConfiguration) *ContainerApplyConfiguration { 155 for i := range values { 156 if values[i] == nil { 157 panic("nil value passed to WithResizePolicy") 158 } 159 b.ResizePolicy = append(b.ResizePolicy, *values[i]) 160 } 161 return b 162 } 163 164 // WithRestartPolicy sets the RestartPolicy field in the declarative configuration to the given value 165 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 166 // If called multiple times, the RestartPolicy field is set to the value of the last call. 167 func (b *ContainerApplyConfiguration) WithRestartPolicy(value corev1.ContainerRestartPolicy) *ContainerApplyConfiguration { 168 b.RestartPolicy = &value 169 return b 170 } 171 172 // WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration 173 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 174 // If called multiple times, values provided by each call will be appended to the VolumeMounts field. 175 func (b *ContainerApplyConfiguration) WithVolumeMounts(values ...*VolumeMountApplyConfiguration) *ContainerApplyConfiguration { 176 for i := range values { 177 if values[i] == nil { 178 panic("nil value passed to WithVolumeMounts") 179 } 180 b.VolumeMounts = append(b.VolumeMounts, *values[i]) 181 } 182 return b 183 } 184 185 // WithVolumeDevices adds the given value to the VolumeDevices field in the declarative configuration 186 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 187 // If called multiple times, values provided by each call will be appended to the VolumeDevices field. 188 func (b *ContainerApplyConfiguration) WithVolumeDevices(values ...*VolumeDeviceApplyConfiguration) *ContainerApplyConfiguration { 189 for i := range values { 190 if values[i] == nil { 191 panic("nil value passed to WithVolumeDevices") 192 } 193 b.VolumeDevices = append(b.VolumeDevices, *values[i]) 194 } 195 return b 196 } 197 198 // WithLivenessProbe sets the LivenessProbe 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 LivenessProbe field is set to the value of the last call. 201 func (b *ContainerApplyConfiguration) WithLivenessProbe(value *ProbeApplyConfiguration) *ContainerApplyConfiguration { 202 b.LivenessProbe = value 203 return b 204 } 205 206 // WithReadinessProbe sets the ReadinessProbe 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 ReadinessProbe field is set to the value of the last call. 209 func (b *ContainerApplyConfiguration) WithReadinessProbe(value *ProbeApplyConfiguration) *ContainerApplyConfiguration { 210 b.ReadinessProbe = value 211 return b 212 } 213 214 // WithStartupProbe sets the StartupProbe 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 StartupProbe field is set to the value of the last call. 217 func (b *ContainerApplyConfiguration) WithStartupProbe(value *ProbeApplyConfiguration) *ContainerApplyConfiguration { 218 b.StartupProbe = value 219 return b 220 } 221 222 // WithLifecycle sets the Lifecycle 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 Lifecycle field is set to the value of the last call. 225 func (b *ContainerApplyConfiguration) WithLifecycle(value *LifecycleApplyConfiguration) *ContainerApplyConfiguration { 226 b.Lifecycle = value 227 return b 228 } 229 230 // WithTerminationMessagePath sets the TerminationMessagePath 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 TerminationMessagePath field is set to the value of the last call. 233 func (b *ContainerApplyConfiguration) WithTerminationMessagePath(value string) *ContainerApplyConfiguration { 234 b.TerminationMessagePath = &value 235 return b 236 } 237 238 // WithTerminationMessagePolicy sets the TerminationMessagePolicy 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 TerminationMessagePolicy field is set to the value of the last call. 241 func (b *ContainerApplyConfiguration) WithTerminationMessagePolicy(value corev1.TerminationMessagePolicy) *ContainerApplyConfiguration { 242 b.TerminationMessagePolicy = &value 243 return b 244 } 245 246 // WithImagePullPolicy sets the ImagePullPolicy field in the declarative configuration to the given value 247 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 248 // If called multiple times, the ImagePullPolicy field is set to the value of the last call. 249 func (b *ContainerApplyConfiguration) WithImagePullPolicy(value corev1.PullPolicy) *ContainerApplyConfiguration { 250 b.ImagePullPolicy = &value 251 return b 252 } 253 254 // WithSecurityContext sets the SecurityContext field in the declarative configuration to the given value 255 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 256 // If called multiple times, the SecurityContext field is set to the value of the last call. 257 func (b *ContainerApplyConfiguration) WithSecurityContext(value *SecurityContextApplyConfiguration) *ContainerApplyConfiguration { 258 b.SecurityContext = value 259 return b 260 } 261 262 // WithStdin sets the Stdin field in the declarative configuration to the given value 263 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 264 // If called multiple times, the Stdin field is set to the value of the last call. 265 func (b *ContainerApplyConfiguration) WithStdin(value bool) *ContainerApplyConfiguration { 266 b.Stdin = &value 267 return b 268 } 269 270 // WithStdinOnce sets the StdinOnce field in the declarative configuration to the given value 271 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 272 // If called multiple times, the StdinOnce field is set to the value of the last call. 273 func (b *ContainerApplyConfiguration) WithStdinOnce(value bool) *ContainerApplyConfiguration { 274 b.StdinOnce = &value 275 return b 276 } 277 278 // WithTTY sets the TTY field in the declarative configuration to the given value 279 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 280 // If called multiple times, the TTY field is set to the value of the last call. 281 func (b *ContainerApplyConfiguration) WithTTY(value bool) *ContainerApplyConfiguration { 282 b.TTY = &value 283 return b 284 } 285