...
1
16
17
18
19 package v2beta2
20
21 import (
22 autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
23 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24 types "k8s.io/apimachinery/pkg/types"
25 managedfields "k8s.io/apimachinery/pkg/util/managedfields"
26 internal "k8s.io/client-go/applyconfigurations/internal"
27 v1 "k8s.io/client-go/applyconfigurations/meta/v1"
28 )
29
30
31
32 type HorizontalPodAutoscalerApplyConfiguration struct {
33 v1.TypeMetaApplyConfiguration `json:",inline"`
34 *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
35 Spec *HorizontalPodAutoscalerSpecApplyConfiguration `json:"spec,omitempty"`
36 Status *HorizontalPodAutoscalerStatusApplyConfiguration `json:"status,omitempty"`
37 }
38
39
40
41 func HorizontalPodAutoscaler(name, namespace string) *HorizontalPodAutoscalerApplyConfiguration {
42 b := &HorizontalPodAutoscalerApplyConfiguration{}
43 b.WithName(name)
44 b.WithNamespace(namespace)
45 b.WithKind("HorizontalPodAutoscaler")
46 b.WithAPIVersion("autoscaling/v2beta2")
47 return b
48 }
49
50
51
52
53
54
55
56
57
58
59
60
61 func ExtractHorizontalPodAutoscaler(horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) {
62 return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "")
63 }
64
65
66
67
68 func ExtractHorizontalPodAutoscalerStatus(horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) {
69 return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "status")
70 }
71
72 func extractHorizontalPodAutoscaler(horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscaler, fieldManager string, subresource string) (*HorizontalPodAutoscalerApplyConfiguration, error) {
73 b := &HorizontalPodAutoscalerApplyConfiguration{}
74 err := managedfields.ExtractInto(horizontalPodAutoscaler, internal.Parser().Type("io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"), fieldManager, b, subresource)
75 if err != nil {
76 return nil, err
77 }
78 b.WithName(horizontalPodAutoscaler.Name)
79 b.WithNamespace(horizontalPodAutoscaler.Namespace)
80
81 b.WithKind("HorizontalPodAutoscaler")
82 b.WithAPIVersion("autoscaling/v2beta2")
83 return b, nil
84 }
85
86
87
88
89 func (b *HorizontalPodAutoscalerApplyConfiguration) WithKind(value string) *HorizontalPodAutoscalerApplyConfiguration {
90 b.Kind = &value
91 return b
92 }
93
94
95
96
97 func (b *HorizontalPodAutoscalerApplyConfiguration) WithAPIVersion(value string) *HorizontalPodAutoscalerApplyConfiguration {
98 b.APIVersion = &value
99 return b
100 }
101
102
103
104
105 func (b *HorizontalPodAutoscalerApplyConfiguration) WithName(value string) *HorizontalPodAutoscalerApplyConfiguration {
106 b.ensureObjectMetaApplyConfigurationExists()
107 b.Name = &value
108 return b
109 }
110
111
112
113
114 func (b *HorizontalPodAutoscalerApplyConfiguration) WithGenerateName(value string) *HorizontalPodAutoscalerApplyConfiguration {
115 b.ensureObjectMetaApplyConfigurationExists()
116 b.GenerateName = &value
117 return b
118 }
119
120
121
122
123 func (b *HorizontalPodAutoscalerApplyConfiguration) WithNamespace(value string) *HorizontalPodAutoscalerApplyConfiguration {
124 b.ensureObjectMetaApplyConfigurationExists()
125 b.Namespace = &value
126 return b
127 }
128
129
130
131
132 func (b *HorizontalPodAutoscalerApplyConfiguration) WithUID(value types.UID) *HorizontalPodAutoscalerApplyConfiguration {
133 b.ensureObjectMetaApplyConfigurationExists()
134 b.UID = &value
135 return b
136 }
137
138
139
140
141 func (b *HorizontalPodAutoscalerApplyConfiguration) WithResourceVersion(value string) *HorizontalPodAutoscalerApplyConfiguration {
142 b.ensureObjectMetaApplyConfigurationExists()
143 b.ResourceVersion = &value
144 return b
145 }
146
147
148
149
150 func (b *HorizontalPodAutoscalerApplyConfiguration) WithGeneration(value int64) *HorizontalPodAutoscalerApplyConfiguration {
151 b.ensureObjectMetaApplyConfigurationExists()
152 b.Generation = &value
153 return b
154 }
155
156
157
158
159 func (b *HorizontalPodAutoscalerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *HorizontalPodAutoscalerApplyConfiguration {
160 b.ensureObjectMetaApplyConfigurationExists()
161 b.CreationTimestamp = &value
162 return b
163 }
164
165
166
167
168 func (b *HorizontalPodAutoscalerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *HorizontalPodAutoscalerApplyConfiguration {
169 b.ensureObjectMetaApplyConfigurationExists()
170 b.DeletionTimestamp = &value
171 return b
172 }
173
174
175
176
177 func (b *HorizontalPodAutoscalerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *HorizontalPodAutoscalerApplyConfiguration {
178 b.ensureObjectMetaApplyConfigurationExists()
179 b.DeletionGracePeriodSeconds = &value
180 return b
181 }
182
183
184
185
186
187 func (b *HorizontalPodAutoscalerApplyConfiguration) WithLabels(entries map[string]string) *HorizontalPodAutoscalerApplyConfiguration {
188 b.ensureObjectMetaApplyConfigurationExists()
189 if b.Labels == nil && len(entries) > 0 {
190 b.Labels = make(map[string]string, len(entries))
191 }
192 for k, v := range entries {
193 b.Labels[k] = v
194 }
195 return b
196 }
197
198
199
200
201
202 func (b *HorizontalPodAutoscalerApplyConfiguration) WithAnnotations(entries map[string]string) *HorizontalPodAutoscalerApplyConfiguration {
203 b.ensureObjectMetaApplyConfigurationExists()
204 if b.Annotations == nil && len(entries) > 0 {
205 b.Annotations = make(map[string]string, len(entries))
206 }
207 for k, v := range entries {
208 b.Annotations[k] = v
209 }
210 return b
211 }
212
213
214
215
216 func (b *HorizontalPodAutoscalerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration {
217 b.ensureObjectMetaApplyConfigurationExists()
218 for i := range values {
219 if values[i] == nil {
220 panic("nil value passed to WithOwnerReferences")
221 }
222 b.OwnerReferences = append(b.OwnerReferences, *values[i])
223 }
224 return b
225 }
226
227
228
229
230 func (b *HorizontalPodAutoscalerApplyConfiguration) WithFinalizers(values ...string) *HorizontalPodAutoscalerApplyConfiguration {
231 b.ensureObjectMetaApplyConfigurationExists()
232 for i := range values {
233 b.Finalizers = append(b.Finalizers, values[i])
234 }
235 return b
236 }
237
238 func (b *HorizontalPodAutoscalerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
239 if b.ObjectMetaApplyConfiguration == nil {
240 b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
241 }
242 }
243
244
245
246
247 func (b *HorizontalPodAutoscalerApplyConfiguration) WithSpec(value *HorizontalPodAutoscalerSpecApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration {
248 b.Spec = value
249 return b
250 }
251
252
253
254
255 func (b *HorizontalPodAutoscalerApplyConfiguration) WithStatus(value *HorizontalPodAutoscalerStatusApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration {
256 b.Status = value
257 return b
258 }
259
View as plain text