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 // CSIPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the CSIPersistentVolumeSource type for use 22 // with apply. 23 type CSIPersistentVolumeSourceApplyConfiguration struct { 24 Driver *string `json:"driver,omitempty"` 25 VolumeHandle *string `json:"volumeHandle,omitempty"` 26 ReadOnly *bool `json:"readOnly,omitempty"` 27 FSType *string `json:"fsType,omitempty"` 28 VolumeAttributes map[string]string `json:"volumeAttributes,omitempty"` 29 ControllerPublishSecretRef *SecretReferenceApplyConfiguration `json:"controllerPublishSecretRef,omitempty"` 30 NodeStageSecretRef *SecretReferenceApplyConfiguration `json:"nodeStageSecretRef,omitempty"` 31 NodePublishSecretRef *SecretReferenceApplyConfiguration `json:"nodePublishSecretRef,omitempty"` 32 ControllerExpandSecretRef *SecretReferenceApplyConfiguration `json:"controllerExpandSecretRef,omitempty"` 33 NodeExpandSecretRef *SecretReferenceApplyConfiguration `json:"nodeExpandSecretRef,omitempty"` 34 } 35 36 // CSIPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the CSIPersistentVolumeSource type for use with 37 // apply. 38 func CSIPersistentVolumeSource() *CSIPersistentVolumeSourceApplyConfiguration { 39 return &CSIPersistentVolumeSourceApplyConfiguration{} 40 } 41 42 // WithDriver sets the Driver field in the declarative configuration to the given value 43 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 // If called multiple times, the Driver field is set to the value of the last call. 45 func (b *CSIPersistentVolumeSourceApplyConfiguration) WithDriver(value string) *CSIPersistentVolumeSourceApplyConfiguration { 46 b.Driver = &value 47 return b 48 } 49 50 // WithVolumeHandle sets the VolumeHandle field in the declarative configuration to the given value 51 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 52 // If called multiple times, the VolumeHandle field is set to the value of the last call. 53 func (b *CSIPersistentVolumeSourceApplyConfiguration) WithVolumeHandle(value string) *CSIPersistentVolumeSourceApplyConfiguration { 54 b.VolumeHandle = &value 55 return b 56 } 57 58 // WithReadOnly sets the ReadOnly 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 ReadOnly field is set to the value of the last call. 61 func (b *CSIPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *CSIPersistentVolumeSourceApplyConfiguration { 62 b.ReadOnly = &value 63 return b 64 } 65 66 // WithFSType sets the FSType 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 FSType field is set to the value of the last call. 69 func (b *CSIPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *CSIPersistentVolumeSourceApplyConfiguration { 70 b.FSType = &value 71 return b 72 } 73 74 // WithVolumeAttributes puts the entries into the VolumeAttributes 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, the entries provided by each call will be put on the VolumeAttributes field, 77 // overwriting an existing map entries in VolumeAttributes field with the same key. 78 func (b *CSIPersistentVolumeSourceApplyConfiguration) WithVolumeAttributes(entries map[string]string) *CSIPersistentVolumeSourceApplyConfiguration { 79 if b.VolumeAttributes == nil && len(entries) > 0 { 80 b.VolumeAttributes = make(map[string]string, len(entries)) 81 } 82 for k, v := range entries { 83 b.VolumeAttributes[k] = v 84 } 85 return b 86 } 87 88 // WithControllerPublishSecretRef sets the ControllerPublishSecretRef field in the declarative configuration to the given value 89 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 90 // If called multiple times, the ControllerPublishSecretRef field is set to the value of the last call. 91 func (b *CSIPersistentVolumeSourceApplyConfiguration) WithControllerPublishSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration { 92 b.ControllerPublishSecretRef = value 93 return b 94 } 95 96 // WithNodeStageSecretRef sets the NodeStageSecretRef field in the declarative configuration to the given value 97 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 98 // If called multiple times, the NodeStageSecretRef field is set to the value of the last call. 99 func (b *CSIPersistentVolumeSourceApplyConfiguration) WithNodeStageSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration { 100 b.NodeStageSecretRef = value 101 return b 102 } 103 104 // WithNodePublishSecretRef sets the NodePublishSecretRef field in the declarative configuration to the given value 105 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 106 // If called multiple times, the NodePublishSecretRef field is set to the value of the last call. 107 func (b *CSIPersistentVolumeSourceApplyConfiguration) WithNodePublishSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration { 108 b.NodePublishSecretRef = value 109 return b 110 } 111 112 // WithControllerExpandSecretRef sets the ControllerExpandSecretRef field in the declarative configuration to the given value 113 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 114 // If called multiple times, the ControllerExpandSecretRef field is set to the value of the last call. 115 func (b *CSIPersistentVolumeSourceApplyConfiguration) WithControllerExpandSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration { 116 b.ControllerExpandSecretRef = value 117 return b 118 } 119 120 // WithNodeExpandSecretRef sets the NodeExpandSecretRef field in the declarative configuration to the given value 121 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 122 // If called multiple times, the NodeExpandSecretRef field is set to the value of the last call. 123 func (b *CSIPersistentVolumeSourceApplyConfiguration) WithNodeExpandSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration { 124 b.NodeExpandSecretRef = value 125 return b 126 } 127