k8s.io/client-go@v0.22.2/applyconfigurations/core/v1/ephemeralcontainer.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  	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  // WithVolumeMounts adds the given value to the VolumeMounts 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 VolumeMounts field.
   132  func (b *EphemeralContainerApplyConfiguration) WithVolumeMounts(values ...*VolumeMountApplyConfiguration) *EphemeralContainerApplyConfiguration {
   133  	for i := range values {
   134  		if values[i] == nil {
   135  			panic("nil value passed to WithVolumeMounts")
   136  		}
   137  		b.VolumeMounts = append(b.VolumeMounts, *values[i])
   138  	}
   139  	return b
   140  }
   141  
   142  // WithVolumeDevices adds the given value to the VolumeDevices field in the declarative configuration
   143  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   144  // If called multiple times, values provided by each call will be appended to the VolumeDevices field.
   145  func (b *EphemeralContainerApplyConfiguration) WithVolumeDevices(values ...*VolumeDeviceApplyConfiguration) *EphemeralContainerApplyConfiguration {
   146  	for i := range values {
   147  		if values[i] == nil {
   148  			panic("nil value passed to WithVolumeDevices")
   149  		}
   150  		b.VolumeDevices = append(b.VolumeDevices, *values[i])
   151  	}
   152  	return b
   153  }
   154  
   155  // WithLivenessProbe sets the LivenessProbe field in the declarative configuration to the given value
   156  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   157  // If called multiple times, the LivenessProbe field is set to the value of the last call.
   158  func (b *EphemeralContainerApplyConfiguration) WithLivenessProbe(value *ProbeApplyConfiguration) *EphemeralContainerApplyConfiguration {
   159  	b.LivenessProbe = value
   160  	return b
   161  }
   162  
   163  // WithReadinessProbe sets the ReadinessProbe field in the declarative configuration to the given value
   164  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   165  // If called multiple times, the ReadinessProbe field is set to the value of the last call.
   166  func (b *EphemeralContainerApplyConfiguration) WithReadinessProbe(value *ProbeApplyConfiguration) *EphemeralContainerApplyConfiguration {
   167  	b.ReadinessProbe = value
   168  	return b
   169  }
   170  
   171  // WithStartupProbe sets the StartupProbe field in the declarative configuration to the given value
   172  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   173  // If called multiple times, the StartupProbe field is set to the value of the last call.
   174  func (b *EphemeralContainerApplyConfiguration) WithStartupProbe(value *ProbeApplyConfiguration) *EphemeralContainerApplyConfiguration {
   175  	b.StartupProbe = value
   176  	return b
   177  }
   178  
   179  // WithLifecycle sets the Lifecycle field in the declarative configuration to the given value
   180  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   181  // If called multiple times, the Lifecycle field is set to the value of the last call.
   182  func (b *EphemeralContainerApplyConfiguration) WithLifecycle(value *LifecycleApplyConfiguration) *EphemeralContainerApplyConfiguration {
   183  	b.Lifecycle = value
   184  	return b
   185  }
   186  
   187  // WithTerminationMessagePath sets the TerminationMessagePath field in the declarative configuration to the given value
   188  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   189  // If called multiple times, the TerminationMessagePath field is set to the value of the last call.
   190  func (b *EphemeralContainerApplyConfiguration) WithTerminationMessagePath(value string) *EphemeralContainerApplyConfiguration {
   191  	b.TerminationMessagePath = &value
   192  	return b
   193  }
   194  
   195  // WithTerminationMessagePolicy sets the TerminationMessagePolicy field in the declarative configuration to the given value
   196  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   197  // If called multiple times, the TerminationMessagePolicy field is set to the value of the last call.
   198  func (b *EphemeralContainerApplyConfiguration) WithTerminationMessagePolicy(value corev1.TerminationMessagePolicy) *EphemeralContainerApplyConfiguration {
   199  	b.TerminationMessagePolicy = &value
   200  	return b
   201  }
   202  
   203  // WithImagePullPolicy sets the ImagePullPolicy field in the declarative configuration to the given value
   204  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   205  // If called multiple times, the ImagePullPolicy field is set to the value of the last call.
   206  func (b *EphemeralContainerApplyConfiguration) WithImagePullPolicy(value corev1.PullPolicy) *EphemeralContainerApplyConfiguration {
   207  	b.ImagePullPolicy = &value
   208  	return b
   209  }
   210  
   211  // WithSecurityContext sets the SecurityContext field in the declarative configuration to the given value
   212  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   213  // If called multiple times, the SecurityContext field is set to the value of the last call.
   214  func (b *EphemeralContainerApplyConfiguration) WithSecurityContext(value *SecurityContextApplyConfiguration) *EphemeralContainerApplyConfiguration {
   215  	b.SecurityContext = value
   216  	return b
   217  }
   218  
   219  // WithStdin sets the Stdin field in the declarative configuration to the given value
   220  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   221  // If called multiple times, the Stdin field is set to the value of the last call.
   222  func (b *EphemeralContainerApplyConfiguration) WithStdin(value bool) *EphemeralContainerApplyConfiguration {
   223  	b.Stdin = &value
   224  	return b
   225  }
   226  
   227  // WithStdinOnce sets the StdinOnce field in the declarative configuration to the given value
   228  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   229  // If called multiple times, the StdinOnce field is set to the value of the last call.
   230  func (b *EphemeralContainerApplyConfiguration) WithStdinOnce(value bool) *EphemeralContainerApplyConfiguration {
   231  	b.StdinOnce = &value
   232  	return b
   233  }
   234  
   235  // WithTTY sets the TTY field in the declarative configuration to the given value
   236  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   237  // If called multiple times, the TTY field is set to the value of the last call.
   238  func (b *EphemeralContainerApplyConfiguration) WithTTY(value bool) *EphemeralContainerApplyConfiguration {
   239  	b.TTY = &value
   240  	return b
   241  }
   242  
   243  // WithTargetContainerName sets the TargetContainerName field in the declarative configuration to the given value
   244  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   245  // If called multiple times, the TargetContainerName field is set to the value of the last call.
   246  func (b *EphemeralContainerApplyConfiguration) WithTargetContainerName(value string) *EphemeralContainerApplyConfiguration {
   247  	b.TargetContainerName = &value
   248  	return b
   249  }