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 appsv1 "k8s.io/api/apps/v1" 23 corev1 "k8s.io/client-go/applyconfigurations/core/v1" 24 v1 "k8s.io/client-go/applyconfigurations/meta/v1" 25 ) 26 27 // StatefulSetSpecApplyConfiguration represents an declarative configuration of the StatefulSetSpec type for use 28 // with apply. 29 type StatefulSetSpecApplyConfiguration struct { 30 Replicas *int32 `json:"replicas,omitempty"` 31 Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` 32 Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` 33 VolumeClaimTemplates []corev1.PersistentVolumeClaimApplyConfiguration `json:"volumeClaimTemplates,omitempty"` 34 ServiceName *string `json:"serviceName,omitempty"` 35 PodManagementPolicy *appsv1.PodManagementPolicyType `json:"podManagementPolicy,omitempty"` 36 UpdateStrategy *StatefulSetUpdateStrategyApplyConfiguration `json:"updateStrategy,omitempty"` 37 RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` 38 MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` 39 PersistentVolumeClaimRetentionPolicy *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration `json:"persistentVolumeClaimRetentionPolicy,omitempty"` 40 Ordinals *StatefulSetOrdinalsApplyConfiguration `json:"ordinals,omitempty"` 41 } 42 43 // StatefulSetSpecApplyConfiguration constructs an declarative configuration of the StatefulSetSpec type for use with 44 // apply. 45 func StatefulSetSpec() *StatefulSetSpecApplyConfiguration { 46 return &StatefulSetSpecApplyConfiguration{} 47 } 48 49 // WithReplicas sets the Replicas field in the declarative configuration to the given value 50 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 51 // If called multiple times, the Replicas field is set to the value of the last call. 52 func (b *StatefulSetSpecApplyConfiguration) WithReplicas(value int32) *StatefulSetSpecApplyConfiguration { 53 b.Replicas = &value 54 return b 55 } 56 57 // WithSelector sets the Selector field in the declarative configuration to the given value 58 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 59 // If called multiple times, the Selector field is set to the value of the last call. 60 func (b *StatefulSetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *StatefulSetSpecApplyConfiguration { 61 b.Selector = value 62 return b 63 } 64 65 // WithTemplate sets the Template field in the declarative configuration to the given value 66 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 67 // If called multiple times, the Template field is set to the value of the last call. 68 func (b *StatefulSetSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *StatefulSetSpecApplyConfiguration { 69 b.Template = value 70 return b 71 } 72 73 // WithVolumeClaimTemplates adds the given value to the VolumeClaimTemplates field in the declarative configuration 74 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 75 // If called multiple times, values provided by each call will be appended to the VolumeClaimTemplates field. 76 func (b *StatefulSetSpecApplyConfiguration) WithVolumeClaimTemplates(values ...*corev1.PersistentVolumeClaimApplyConfiguration) *StatefulSetSpecApplyConfiguration { 77 for i := range values { 78 if values[i] == nil { 79 panic("nil value passed to WithVolumeClaimTemplates") 80 } 81 b.VolumeClaimTemplates = append(b.VolumeClaimTemplates, *values[i]) 82 } 83 return b 84 } 85 86 // WithServiceName sets the ServiceName 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 ServiceName field is set to the value of the last call. 89 func (b *StatefulSetSpecApplyConfiguration) WithServiceName(value string) *StatefulSetSpecApplyConfiguration { 90 b.ServiceName = &value 91 return b 92 } 93 94 // WithPodManagementPolicy sets the PodManagementPolicy 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 PodManagementPolicy field is set to the value of the last call. 97 func (b *StatefulSetSpecApplyConfiguration) WithPodManagementPolicy(value appsv1.PodManagementPolicyType) *StatefulSetSpecApplyConfiguration { 98 b.PodManagementPolicy = &value 99 return b 100 } 101 102 // WithUpdateStrategy sets the UpdateStrategy 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 UpdateStrategy field is set to the value of the last call. 105 func (b *StatefulSetSpecApplyConfiguration) WithUpdateStrategy(value *StatefulSetUpdateStrategyApplyConfiguration) *StatefulSetSpecApplyConfiguration { 106 b.UpdateStrategy = value 107 return b 108 } 109 110 // WithRevisionHistoryLimit sets the RevisionHistoryLimit 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 RevisionHistoryLimit field is set to the value of the last call. 113 func (b *StatefulSetSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *StatefulSetSpecApplyConfiguration { 114 b.RevisionHistoryLimit = &value 115 return b 116 } 117 118 // WithMinReadySeconds sets the MinReadySeconds 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 MinReadySeconds field is set to the value of the last call. 121 func (b *StatefulSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *StatefulSetSpecApplyConfiguration { 122 b.MinReadySeconds = &value 123 return b 124 } 125 126 // WithPersistentVolumeClaimRetentionPolicy sets the PersistentVolumeClaimRetentionPolicy 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 PersistentVolumeClaimRetentionPolicy field is set to the value of the last call. 129 func (b *StatefulSetSpecApplyConfiguration) WithPersistentVolumeClaimRetentionPolicy(value *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration) *StatefulSetSpecApplyConfiguration { 130 b.PersistentVolumeClaimRetentionPolicy = value 131 return b 132 } 133 134 // WithOrdinals sets the Ordinals 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 Ordinals field is set to the value of the last call. 137 func (b *StatefulSetSpecApplyConfiguration) WithOrdinals(value *StatefulSetOrdinalsApplyConfiguration) *StatefulSetSpecApplyConfiguration { 138 b.Ordinals = value 139 return b 140 } 141