| 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 v1beta1 |
| 20 |
|
| 21 |
import ( |
| 22 |
storagev1beta1 "k8s.io/api/storage/v1beta1" |
| 23 |
) |
| 24 |
|
| 25 |
// CSIDriverSpecApplyConfiguration represents a declarative configuration of the CSIDriverSpec type for use |
| 26 |
// with apply. |
| 27 |
type CSIDriverSpecApplyConfiguration struct { |
| 28 |
AttachRequired *bool `json:"attachRequired,omitempty"` |
| 29 |
PodInfoOnMount *bool `json:"podInfoOnMount,omitempty"` |
| 30 |
VolumeLifecycleModes []storagev1beta1.VolumeLifecycleMode `json:"volumeLifecycleModes,omitempty"` |
| 31 |
StorageCapacity *bool `json:"storageCapacity,omitempty"` |
| 32 |
FSGroupPolicy *storagev1beta1.FSGroupPolicy `json:"fsGroupPolicy,omitempty"` |
| 33 |
TokenRequests []TokenRequestApplyConfiguration `json:"tokenRequests,omitempty"` |
| 34 |
RequiresRepublish *bool `json:"requiresRepublish,omitempty"` |
| 35 |
SELinuxMount *bool `json:"seLinuxMount,omitempty"` |
| 36 |
NodeAllocatableUpdatePeriodSeconds *int64 `json:"nodeAllocatableUpdatePeriodSeconds,omitempty"` |
| 37 |
} |
| 38 |
|
| 39 |
// CSIDriverSpecApplyConfiguration constructs a declarative configuration of the CSIDriverSpec type for use with |
| 40 |
// apply. |
| 41 |
func CSIDriverSpec() *CSIDriverSpecApplyConfiguration { |
| 42 |
return &CSIDriverSpecApplyConfiguration{} |
| 43 |
} |
| 44 |
|
| 45 |
// WithAttachRequired sets the AttachRequired field in the declarative configuration to the given value |
| 46 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 47 |
// If called multiple times, the AttachRequired field is set to the value of the last call. |
| 48 |
func (b *CSIDriverSpecApplyConfiguration) WithAttachRequired(value bool) *CSIDriverSpecApplyConfiguration { |
| 49 |
b.AttachRequired = &value |
| 50 |
return b |
| 51 |
} |
| 52 |
|
| 53 |
// WithPodInfoOnMount sets the PodInfoOnMount field in the declarative configuration to the given value |
| 54 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 55 |
// If called multiple times, the PodInfoOnMount field is set to the value of the last call. |
| 56 |
func (b *CSIDriverSpecApplyConfiguration) WithPodInfoOnMount(value bool) *CSIDriverSpecApplyConfiguration { |
| 57 |
b.PodInfoOnMount = &value |
| 58 |
return b |
| 59 |
} |
| 60 |
|
| 61 |
// WithVolumeLifecycleModes adds the given value to the VolumeLifecycleModes field in the declarative configuration |
| 62 |
// and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 63 |
// If called multiple times, values provided by each call will be appended to the VolumeLifecycleModes field. |
| 64 |
func (b *CSIDriverSpecApplyConfiguration) WithVolumeLifecycleModes(values ...storagev1beta1.VolumeLifecycleMode) *CSIDriverSpecApplyConfiguration { |
| 65 |
for i := range values { |
| 66 |
b.VolumeLifecycleModes = append(b.VolumeLifecycleModes, values[i]) |
| 67 |
} |
| 68 |
return b |
| 69 |
} |
| 70 |
|
| 71 |
// WithStorageCapacity sets the StorageCapacity field in the declarative configuration to the given value |
| 72 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 73 |
// If called multiple times, the StorageCapacity field is set to the value of the last call. |
| 74 |
func (b *CSIDriverSpecApplyConfiguration) WithStorageCapacity(value bool) *CSIDriverSpecApplyConfiguration { |
| 75 |
b.StorageCapacity = &value |
| 76 |
return b |
| 77 |
} |
| 78 |
|
| 79 |
// WithFSGroupPolicy sets the FSGroupPolicy field in the declarative configuration to the given value |
| 80 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 81 |
// If called multiple times, the FSGroupPolicy field is set to the value of the last call. |
| 82 |
func (b *CSIDriverSpecApplyConfiguration) WithFSGroupPolicy(value storagev1beta1.FSGroupPolicy) *CSIDriverSpecApplyConfiguration { |
| 83 |
b.FSGroupPolicy = &value |
| 84 |
return b |
| 85 |
} |
| 86 |
|
| 87 |
// WithTokenRequests adds the given value to the TokenRequests field in the declarative configuration |
| 88 |
// and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 89 |
// If called multiple times, values provided by each call will be appended to the TokenRequests field. |
| 90 |
func (b *CSIDriverSpecApplyConfiguration) WithTokenRequests(values ...*TokenRequestApplyConfiguration) *CSIDriverSpecApplyConfiguration { |
| 91 |
for i := range values { |
| 92 |
if values[i] == nil { |
| 93 |
panic("nil value passed to WithTokenRequests") |
| 94 |
} |
| 95 |
b.TokenRequests = append(b.TokenRequests, *values[i]) |
| 96 |
} |
| 97 |
return b |
| 98 |
} |
| 99 |
|
| 100 |
// WithRequiresRepublish sets the RequiresRepublish field in the declarative configuration to the given value |
| 101 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 102 |
// If called multiple times, the RequiresRepublish field is set to the value of the last call. |
| 103 |
func (b *CSIDriverSpecApplyConfiguration) WithRequiresRepublish(value bool) *CSIDriverSpecApplyConfiguration { |
| 104 |
b.RequiresRepublish = &value |
| 105 |
return b |
| 106 |
} |
| 107 |
|
| 108 |
// WithSELinuxMount sets the SELinuxMount field in the declarative configuration to the given value |
| 109 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 110 |
// If called multiple times, the SELinuxMount field is set to the value of the last call. |
| 111 |
func (b *CSIDriverSpecApplyConfiguration) WithSELinuxMount(value bool) *CSIDriverSpecApplyConfiguration { |
| 112 |
b.SELinuxMount = &value |
| 113 |
return b |
| 114 |
} |
| 115 |
|
| 116 |
// WithNodeAllocatableUpdatePeriodSeconds sets the NodeAllocatableUpdatePeriodSeconds field in the declarative configuration to the given value |
| 117 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 118 |
// If called multiple times, the NodeAllocatableUpdatePeriodSeconds field is set to the value of the last call. |
| 119 |
func (b *CSIDriverSpecApplyConfiguration) WithNodeAllocatableUpdatePeriodSeconds(value int64) *CSIDriverSpecApplyConfiguration { |
| 120 |
b.NodeAllocatableUpdatePeriodSeconds = &value |
| 121 |
return b |
| 122 |
} |