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