| 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 |
// PersistentVolumeSpecApplyConfiguration represents a declarative configuration of the PersistentVolumeSpec type for use |
| 26 |
// with apply. |
| 27 |
type PersistentVolumeSpecApplyConfiguration struct { |
| 28 |
Capacity *corev1.ResourceList `json:"capacity,omitempty"` |
| 29 |
PersistentVolumeSourceApplyConfiguration `json:",inline"` |
| 30 |
AccessModes []corev1.PersistentVolumeAccessMode `json:"accessModes,omitempty"` |
| 31 |
ClaimRef *ObjectReferenceApplyConfiguration `json:"claimRef,omitempty"` |
| 32 |
PersistentVolumeReclaimPolicy *corev1.PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy,omitempty"` |
| 33 |
StorageClassName *string `json:"storageClassName,omitempty"` |
| 34 |
MountOptions []string `json:"mountOptions,omitempty"` |
| 35 |
VolumeMode *corev1.PersistentVolumeMode `json:"volumeMode,omitempty"` |
| 36 |
NodeAffinity *VolumeNodeAffinityApplyConfiguration `json:"nodeAffinity,omitempty"` |
| 37 |
VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty"` |
| 38 |
} |
| 39 |
|
| 40 |
// PersistentVolumeSpecApplyConfiguration constructs a declarative configuration of the PersistentVolumeSpec type for use with |
| 41 |
// apply. |
| 42 |
func PersistentVolumeSpec() *PersistentVolumeSpecApplyConfiguration { |
| 43 |
return &PersistentVolumeSpecApplyConfiguration{} |
| 44 |
} |
| 45 |
|
| 46 |
// WithCapacity sets the Capacity 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 Capacity field is set to the value of the last call. |
| 49 |
func (b *PersistentVolumeSpecApplyConfiguration) WithCapacity(value corev1.ResourceList) *PersistentVolumeSpecApplyConfiguration { |
| 50 |
b.Capacity = &value |
| 51 |
return b |
| 52 |
} |
| 53 |
|
| 54 |
// WithGCEPersistentDisk sets the GCEPersistentDisk field in the declarative configuration to the given value |
| 55 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 56 |
// If called multiple times, the GCEPersistentDisk field is set to the value of the last call. |
| 57 |
func (b *PersistentVolumeSpecApplyConfiguration) WithGCEPersistentDisk(value *GCEPersistentDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 58 |
b.PersistentVolumeSourceApplyConfiguration.GCEPersistentDisk = value |
| 59 |
return b |
| 60 |
} |
| 61 |
|
| 62 |
// WithAWSElasticBlockStore sets the AWSElasticBlockStore field in the declarative configuration to the given value |
| 63 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 64 |
// If called multiple times, the AWSElasticBlockStore field is set to the value of the last call. |
| 65 |
func (b *PersistentVolumeSpecApplyConfiguration) WithAWSElasticBlockStore(value *AWSElasticBlockStoreVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 66 |
b.PersistentVolumeSourceApplyConfiguration.AWSElasticBlockStore = value |
| 67 |
return b |
| 68 |
} |
| 69 |
|
| 70 |
// WithHostPath sets the HostPath field in the declarative configuration to the given value |
| 71 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 72 |
// If called multiple times, the HostPath field is set to the value of the last call. |
| 73 |
func (b *PersistentVolumeSpecApplyConfiguration) WithHostPath(value *HostPathVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 74 |
b.PersistentVolumeSourceApplyConfiguration.HostPath = value |
| 75 |
return b |
| 76 |
} |
| 77 |
|
| 78 |
// WithGlusterfs sets the Glusterfs field in the declarative configuration to the given value |
| 79 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 80 |
// If called multiple times, the Glusterfs field is set to the value of the last call. |
| 81 |
func (b *PersistentVolumeSpecApplyConfiguration) WithGlusterfs(value *GlusterfsPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 82 |
b.PersistentVolumeSourceApplyConfiguration.Glusterfs = value |
| 83 |
return b |
| 84 |
} |
| 85 |
|
| 86 |
// WithNFS sets the NFS field in the declarative configuration to the given value |
| 87 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 88 |
// If called multiple times, the NFS field is set to the value of the last call. |
| 89 |
func (b *PersistentVolumeSpecApplyConfiguration) WithNFS(value *NFSVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 90 |
b.PersistentVolumeSourceApplyConfiguration.NFS = value |
| 91 |
return b |
| 92 |
} |
| 93 |
|
| 94 |
// WithRBD sets the RBD 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 RBD field is set to the value of the last call. |
| 97 |
func (b *PersistentVolumeSpecApplyConfiguration) WithRBD(value *RBDPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 98 |
b.PersistentVolumeSourceApplyConfiguration.RBD = value |
| 99 |
return b |
| 100 |
} |
| 101 |
|
| 102 |
// WithISCSI sets the ISCSI field in the declarative configuration to the given value |
| 103 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 104 |
// If called multiple times, the ISCSI field is set to the value of the last call. |
| 105 |
func (b *PersistentVolumeSpecApplyConfiguration) WithISCSI(value *ISCSIPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 106 |
b.PersistentVolumeSourceApplyConfiguration.ISCSI = value |
| 107 |
return b |
| 108 |
} |
| 109 |
|
| 110 |
// WithCinder sets the Cinder field in the declarative configuration to the given value |
| 111 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 112 |
// If called multiple times, the Cinder field is set to the value of the last call. |
| 113 |
func (b *PersistentVolumeSpecApplyConfiguration) WithCinder(value *CinderPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 114 |
b.PersistentVolumeSourceApplyConfiguration.Cinder = value |
| 115 |
return b |
| 116 |
} |
| 117 |
|
| 118 |
// WithCephFS sets the CephFS field in the declarative configuration to the given value |
| 119 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 120 |
// If called multiple times, the CephFS field is set to the value of the last call. |
| 121 |
func (b *PersistentVolumeSpecApplyConfiguration) WithCephFS(value *CephFSPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 122 |
b.PersistentVolumeSourceApplyConfiguration.CephFS = value |
| 123 |
return b |
| 124 |
} |
| 125 |
|
| 126 |
// WithFC sets the FC field in the declarative configuration to the given value |
| 127 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 128 |
// If called multiple times, the FC field is set to the value of the last call. |
| 129 |
func (b *PersistentVolumeSpecApplyConfiguration) WithFC(value *FCVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 130 |
b.PersistentVolumeSourceApplyConfiguration.FC = value |
| 131 |
return b |
| 132 |
} |
| 133 |
|
| 134 |
// WithFlocker sets the Flocker field in the declarative configuration to the given value |
| 135 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 136 |
// If called multiple times, the Flocker field is set to the value of the last call. |
| 137 |
func (b *PersistentVolumeSpecApplyConfiguration) WithFlocker(value *FlockerVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 138 |
b.PersistentVolumeSourceApplyConfiguration.Flocker = value |
| 139 |
return b |
| 140 |
} |
| 141 |
|
| 142 |
// WithFlexVolume sets the FlexVolume 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 FlexVolume field is set to the value of the last call. |
| 145 |
func (b *PersistentVolumeSpecApplyConfiguration) WithFlexVolume(value *FlexPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 146 |
b.PersistentVolumeSourceApplyConfiguration.FlexVolume = value |
| 147 |
return b |
| 148 |
} |
| 149 |
|
| 150 |
// WithAzureFile sets the AzureFile field in the declarative configuration to the given value |
| 151 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 152 |
// If called multiple times, the AzureFile field is set to the value of the last call. |
| 153 |
func (b *PersistentVolumeSpecApplyConfiguration) WithAzureFile(value *AzureFilePersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 154 |
b.PersistentVolumeSourceApplyConfiguration.AzureFile = value |
| 155 |
return b |
| 156 |
} |
| 157 |
|
| 158 |
// WithVsphereVolume sets the VsphereVolume field in the declarative configuration to the given value |
| 159 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 160 |
// If called multiple times, the VsphereVolume field is set to the value of the last call. |
| 161 |
func (b *PersistentVolumeSpecApplyConfiguration) WithVsphereVolume(value *VsphereVirtualDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 162 |
b.PersistentVolumeSourceApplyConfiguration.VsphereVolume = value |
| 163 |
return b |
| 164 |
} |
| 165 |
|
| 166 |
// WithQuobyte sets the Quobyte field in the declarative configuration to the given value |
| 167 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 168 |
// If called multiple times, the Quobyte field is set to the value of the last call. |
| 169 |
func (b *PersistentVolumeSpecApplyConfiguration) WithQuobyte(value *QuobyteVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 170 |
b.PersistentVolumeSourceApplyConfiguration.Quobyte = value |
| 171 |
return b |
| 172 |
} |
| 173 |
|
| 174 |
// WithAzureDisk sets the AzureDisk field in the declarative configuration to the given value |
| 175 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 176 |
// If called multiple times, the AzureDisk field is set to the value of the last call. |
| 177 |
func (b *PersistentVolumeSpecApplyConfiguration) WithAzureDisk(value *AzureDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 178 |
b.PersistentVolumeSourceApplyConfiguration.AzureDisk = value |
| 179 |
return b |
| 180 |
} |
| 181 |
|
| 182 |
// WithPhotonPersistentDisk sets the PhotonPersistentDisk field in the declarative configuration to the given value |
| 183 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 184 |
// If called multiple times, the PhotonPersistentDisk field is set to the value of the last call. |
| 185 |
func (b *PersistentVolumeSpecApplyConfiguration) WithPhotonPersistentDisk(value *PhotonPersistentDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 186 |
b.PersistentVolumeSourceApplyConfiguration.PhotonPersistentDisk = value |
| 187 |
return b |
| 188 |
} |
| 189 |
|
| 190 |
// WithPortworxVolume sets the PortworxVolume field in the declarative configuration to the given value |
| 191 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 192 |
// If called multiple times, the PortworxVolume field is set to the value of the last call. |
| 193 |
func (b *PersistentVolumeSpecApplyConfiguration) WithPortworxVolume(value *PortworxVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 194 |
b.PersistentVolumeSourceApplyConfiguration.PortworxVolume = value |
| 195 |
return b |
| 196 |
} |
| 197 |
|
| 198 |
// WithScaleIO sets the ScaleIO 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 ScaleIO field is set to the value of the last call. |
| 201 |
func (b *PersistentVolumeSpecApplyConfiguration) WithScaleIO(value *ScaleIOPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 202 |
b.PersistentVolumeSourceApplyConfiguration.ScaleIO = value |
| 203 |
return b |
| 204 |
} |
| 205 |
|
| 206 |
// WithLocal sets the Local 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 Local field is set to the value of the last call. |
| 209 |
func (b *PersistentVolumeSpecApplyConfiguration) WithLocal(value *LocalVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 210 |
b.PersistentVolumeSourceApplyConfiguration.Local = value |
| 211 |
return b |
| 212 |
} |
| 213 |
|
| 214 |
// WithStorageOS sets the StorageOS 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 StorageOS field is set to the value of the last call. |
| 217 |
func (b *PersistentVolumeSpecApplyConfiguration) WithStorageOS(value *StorageOSPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 218 |
b.PersistentVolumeSourceApplyConfiguration.StorageOS = value |
| 219 |
return b |
| 220 |
} |
| 221 |
|
| 222 |
// WithCSI sets the CSI 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 CSI field is set to the value of the last call. |
| 225 |
func (b *PersistentVolumeSpecApplyConfiguration) WithCSI(value *CSIPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 226 |
b.PersistentVolumeSourceApplyConfiguration.CSI = value |
| 227 |
return b |
| 228 |
} |
| 229 |
|
| 230 |
// WithAccessModes adds the given value to the AccessModes field in the declarative configuration |
| 231 |
// and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 232 |
// If called multiple times, values provided by each call will be appended to the AccessModes field. |
| 233 |
func (b *PersistentVolumeSpecApplyConfiguration) WithAccessModes(values ...corev1.PersistentVolumeAccessMode) *PersistentVolumeSpecApplyConfiguration { |
| 234 |
for i := range values { |
| 235 |
b.AccessModes = append(b.AccessModes, values[i]) |
| 236 |
} |
| 237 |
return b |
| 238 |
} |
| 239 |
|
| 240 |
// WithClaimRef sets the ClaimRef 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 ClaimRef field is set to the value of the last call. |
| 243 |
func (b *PersistentVolumeSpecApplyConfiguration) WithClaimRef(value *ObjectReferenceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 244 |
b.ClaimRef = value |
| 245 |
return b |
| 246 |
} |
| 247 |
|
| 248 |
// WithPersistentVolumeReclaimPolicy sets the PersistentVolumeReclaimPolicy 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 PersistentVolumeReclaimPolicy field is set to the value of the last call. |
| 251 |
func (b *PersistentVolumeSpecApplyConfiguration) WithPersistentVolumeReclaimPolicy(value corev1.PersistentVolumeReclaimPolicy) *PersistentVolumeSpecApplyConfiguration { |
| 252 |
b.PersistentVolumeReclaimPolicy = &value |
| 253 |
return b |
| 254 |
} |
| 255 |
|
| 256 |
// WithStorageClassName sets the StorageClassName 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 StorageClassName field is set to the value of the last call. |
| 259 |
func (b *PersistentVolumeSpecApplyConfiguration) WithStorageClassName(value string) *PersistentVolumeSpecApplyConfiguration { |
| 260 |
b.StorageClassName = &value |
| 261 |
return b |
| 262 |
} |
| 263 |
|
| 264 |
// WithMountOptions adds the given value to the MountOptions field in the declarative configuration |
| 265 |
// and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 266 |
// If called multiple times, values provided by each call will be appended to the MountOptions field. |
| 267 |
func (b *PersistentVolumeSpecApplyConfiguration) WithMountOptions(values ...string) *PersistentVolumeSpecApplyConfiguration { |
| 268 |
for i := range values { |
| 269 |
b.MountOptions = append(b.MountOptions, values[i]) |
| 270 |
} |
| 271 |
return b |
| 272 |
} |
| 273 |
|
| 274 |
// WithVolumeMode sets the VolumeMode field in the declarative configuration to the given value |
| 275 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 276 |
// If called multiple times, the VolumeMode field is set to the value of the last call. |
| 277 |
func (b *PersistentVolumeSpecApplyConfiguration) WithVolumeMode(value corev1.PersistentVolumeMode) *PersistentVolumeSpecApplyConfiguration { |
| 278 |
b.VolumeMode = &value |
| 279 |
return b |
| 280 |
} |
| 281 |
|
| 282 |
// WithNodeAffinity sets the NodeAffinity field in the declarative configuration to the given value |
| 283 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 284 |
// If called multiple times, the NodeAffinity field is set to the value of the last call. |
| 285 |
func (b *PersistentVolumeSpecApplyConfiguration) WithNodeAffinity(value *VolumeNodeAffinityApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { |
| 286 |
b.NodeAffinity = value |
| 287 |
return b |
| 288 |
} |
| 289 |
|
| 290 |
// WithVolumeAttributesClassName sets the VolumeAttributesClassName field in the declarative configuration to the given value |
| 291 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 292 |
// If called multiple times, the VolumeAttributesClassName field is set to the value of the last call. |
| 293 |
func (b *PersistentVolumeSpecApplyConfiguration) WithVolumeAttributesClassName(value string) *PersistentVolumeSpecApplyConfiguration { |
| 294 |
b.VolumeAttributesClassName = &value |
| 295 |
return b |
| 296 |
} |