| 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 |
// ContainerStatusApplyConfiguration represents a declarative configuration of the ContainerStatus type for use |
| 26 |
// with apply. |
| 27 |
type ContainerStatusApplyConfiguration struct { |
| 28 |
Name *string `json:"name,omitempty"` |
| 29 |
State *ContainerStateApplyConfiguration `json:"state,omitempty"` |
| 30 |
LastTerminationState *ContainerStateApplyConfiguration `json:"lastState,omitempty"` |
| 31 |
Ready *bool `json:"ready,omitempty"` |
| 32 |
RestartCount *int32 `json:"restartCount,omitempty"` |
| 33 |
Image *string `json:"image,omitempty"` |
| 34 |
ImageID *string `json:"imageID,omitempty"` |
| 35 |
ContainerID *string `json:"containerID,omitempty"` |
| 36 |
Started *bool `json:"started,omitempty"` |
| 37 |
AllocatedResources *corev1.ResourceList `json:"allocatedResources,omitempty"` |
| 38 |
Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` |
| 39 |
VolumeMounts []VolumeMountStatusApplyConfiguration `json:"volumeMounts,omitempty"` |
| 40 |
User *ContainerUserApplyConfiguration `json:"user,omitempty"` |
| 41 |
AllocatedResourcesStatus []ResourceStatusApplyConfiguration `json:"allocatedResourcesStatus,omitempty"` |
| 42 |
StopSignal *corev1.Signal `json:"stopSignal,omitempty"` |
| 43 |
} |
| 44 |
|
| 45 |
// ContainerStatusApplyConfiguration constructs a declarative configuration of the ContainerStatus type for use with |
| 46 |
// apply. |
| 47 |
func ContainerStatus() *ContainerStatusApplyConfiguration { |
| 48 |
return &ContainerStatusApplyConfiguration{} |
| 49 |
} |
| 50 |
|
| 51 |
// WithName sets the Name field in the declarative configuration to the given value |
| 52 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 53 |
// If called multiple times, the Name field is set to the value of the last call. |
| 54 |
func (b *ContainerStatusApplyConfiguration) WithName(value string) *ContainerStatusApplyConfiguration { |
| 55 |
b.Name = &value |
| 56 |
return b |
| 57 |
} |
| 58 |
|
| 59 |
// WithState sets the State field in the declarative configuration to the given value |
| 60 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 61 |
// If called multiple times, the State field is set to the value of the last call. |
| 62 |
func (b *ContainerStatusApplyConfiguration) WithState(value *ContainerStateApplyConfiguration) *ContainerStatusApplyConfiguration { |
| 63 |
b.State = value |
| 64 |
return b |
| 65 |
} |
| 66 |
|
| 67 |
// WithLastTerminationState sets the LastTerminationState field in the declarative configuration to the given value |
| 68 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 69 |
// If called multiple times, the LastTerminationState field is set to the value of the last call. |
| 70 |
func (b *ContainerStatusApplyConfiguration) WithLastTerminationState(value *ContainerStateApplyConfiguration) *ContainerStatusApplyConfiguration { |
| 71 |
b.LastTerminationState = value |
| 72 |
return b |
| 73 |
} |
| 74 |
|
| 75 |
// WithReady sets the Ready field in the declarative configuration to the given value |
| 76 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 77 |
// If called multiple times, the Ready field is set to the value of the last call. |
| 78 |
func (b *ContainerStatusApplyConfiguration) WithReady(value bool) *ContainerStatusApplyConfiguration { |
| 79 |
b.Ready = &value |
| 80 |
return b |
| 81 |
} |
| 82 |
|
| 83 |
// WithRestartCount sets the RestartCount field in the declarative configuration to the given value |
| 84 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 85 |
// If called multiple times, the RestartCount field is set to the value of the last call. |
| 86 |
func (b *ContainerStatusApplyConfiguration) WithRestartCount(value int32) *ContainerStatusApplyConfiguration { |
| 87 |
b.RestartCount = &value |
| 88 |
return b |
| 89 |
} |
| 90 |
|
| 91 |
// WithImage sets the Image field in the declarative configuration to the given value |
| 92 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 93 |
// If called multiple times, the Image field is set to the value of the last call. |
| 94 |
func (b *ContainerStatusApplyConfiguration) WithImage(value string) *ContainerStatusApplyConfiguration { |
| 95 |
b.Image = &value |
| 96 |
return b |
| 97 |
} |
| 98 |
|
| 99 |
// WithImageID sets the ImageID field in the declarative configuration to the given value |
| 100 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 101 |
// If called multiple times, the ImageID field is set to the value of the last call. |
| 102 |
func (b *ContainerStatusApplyConfiguration) WithImageID(value string) *ContainerStatusApplyConfiguration { |
| 103 |
b.ImageID = &value |
| 104 |
return b |
| 105 |
} |
| 106 |
|
| 107 |
// WithContainerID sets the ContainerID field in the declarative configuration to the given value |
| 108 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 109 |
// If called multiple times, the ContainerID field is set to the value of the last call. |
| 110 |
func (b *ContainerStatusApplyConfiguration) WithContainerID(value string) *ContainerStatusApplyConfiguration { |
| 111 |
b.ContainerID = &value |
| 112 |
return b |
| 113 |
} |
| 114 |
|
| 115 |
// WithStarted sets the Started field in the declarative configuration to the given value |
| 116 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 117 |
// If called multiple times, the Started field is set to the value of the last call. |
| 118 |
func (b *ContainerStatusApplyConfiguration) WithStarted(value bool) *ContainerStatusApplyConfiguration { |
| 119 |
b.Started = &value |
| 120 |
return b |
| 121 |
} |
| 122 |
|
| 123 |
// WithAllocatedResources sets the AllocatedResources field in the declarative configuration to the given value |
| 124 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 125 |
// If called multiple times, the AllocatedResources field is set to the value of the last call. |
| 126 |
func (b *ContainerStatusApplyConfiguration) WithAllocatedResources(value corev1.ResourceList) *ContainerStatusApplyConfiguration { |
| 127 |
b.AllocatedResources = &value |
| 128 |
return b |
| 129 |
} |
| 130 |
|
| 131 |
// WithResources sets the Resources field in the declarative configuration to the given value |
| 132 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 133 |
// If called multiple times, the Resources field is set to the value of the last call. |
| 134 |
func (b *ContainerStatusApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *ContainerStatusApplyConfiguration { |
| 135 |
b.Resources = value |
| 136 |
return b |
| 137 |
} |
| 138 |
|
| 139 |
// WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration |
| 140 |
// and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 141 |
// If called multiple times, values provided by each call will be appended to the VolumeMounts field. |
| 142 |
func (b *ContainerStatusApplyConfiguration) WithVolumeMounts(values ...*VolumeMountStatusApplyConfiguration) *ContainerStatusApplyConfiguration { |
| 143 |
for i := range values { |
| 144 |
if values[i] == nil { |
| 145 |
panic("nil value passed to WithVolumeMounts") |
| 146 |
} |
| 147 |
b.VolumeMounts = append(b.VolumeMounts, *values[i]) |
| 148 |
} |
| 149 |
return b |
| 150 |
} |
| 151 |
|
| 152 |
// WithUser sets the User 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 User field is set to the value of the last call. |
| 155 |
func (b *ContainerStatusApplyConfiguration) WithUser(value *ContainerUserApplyConfiguration) *ContainerStatusApplyConfiguration { |
| 156 |
b.User = value |
| 157 |
return b |
| 158 |
} |
| 159 |
|
| 160 |
// WithAllocatedResourcesStatus adds the given value to the AllocatedResourcesStatus 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, values provided by each call will be appended to the AllocatedResourcesStatus field. |
| 163 |
func (b *ContainerStatusApplyConfiguration) WithAllocatedResourcesStatus(values ...*ResourceStatusApplyConfiguration) *ContainerStatusApplyConfiguration { |
| 164 |
for i := range values { |
| 165 |
if values[i] == nil { |
| 166 |
panic("nil value passed to WithAllocatedResourcesStatus") |
| 167 |
} |
| 168 |
b.AllocatedResourcesStatus = append(b.AllocatedResourcesStatus, *values[i]) |
| 169 |
} |
| 170 |
return b |
| 171 |
} |
| 172 |
|
| 173 |
// WithStopSignal sets the StopSignal field in the declarative configuration to the given value |
| 174 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 175 |
// If called multiple times, the StopSignal field is set to the value of the last call. |
| 176 |
func (b *ContainerStatusApplyConfiguration) WithStopSignal(value corev1.Signal) *ContainerStatusApplyConfiguration { |
| 177 |
b.StopSignal = &value |
| 178 |
return b |
| 179 |
} |