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