/
hostedclusterspec.go
294 lines (259 loc) · 17.1 KB
/
hostedclusterspec.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
import (
v1 "github.com/openshift/api/config/v1"
hypershiftv1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1"
corev1 "k8s.io/api/core/v1"
)
// HostedClusterSpecApplyConfiguration represents an declarative configuration of the HostedClusterSpec type for use
// with apply.
type HostedClusterSpecApplyConfiguration struct {
Release *ReleaseApplyConfiguration `json:"release,omitempty"`
ControlPlaneRelease *ReleaseApplyConfiguration `json:"controlPlaneRelease,omitempty"`
ClusterID *string `json:"clusterID,omitempty"`
UpdateService *v1.URL `json:"updateService,omitempty"`
Channel *string `json:"channel,omitempty"`
InfraID *string `json:"infraID,omitempty"`
Platform *PlatformSpecApplyConfiguration `json:"platform,omitempty"`
ControllerAvailabilityPolicy *hypershiftv1beta1.AvailabilityPolicy `json:"controllerAvailabilityPolicy,omitempty"`
InfrastructureAvailabilityPolicy *hypershiftv1beta1.AvailabilityPolicy `json:"infrastructureAvailabilityPolicy,omitempty"`
DNS *DNSSpecApplyConfiguration `json:"dns,omitempty"`
Networking *ClusterNetworkingApplyConfiguration `json:"networking,omitempty"`
Autoscaling *ClusterAutoscalingApplyConfiguration `json:"autoscaling,omitempty"`
Etcd *EtcdSpecApplyConfiguration `json:"etcd,omitempty"`
Services []ServicePublishingStrategyMappingApplyConfiguration `json:"services,omitempty"`
PullSecret *corev1.LocalObjectReference `json:"pullSecret,omitempty"`
SSHKey *corev1.LocalObjectReference `json:"sshKey,omitempty"`
IssuerURL *string `json:"issuerURL,omitempty"`
ServiceAccountSigningKey *corev1.LocalObjectReference `json:"serviceAccountSigningKey,omitempty"`
Configuration *ClusterConfigurationApplyConfiguration `json:"configuration,omitempty"`
AuditWebhook *corev1.LocalObjectReference `json:"auditWebhook,omitempty"`
ImageContentSources []ImageContentSourceApplyConfiguration `json:"imageContentSources,omitempty"`
AdditionalTrustBundle *corev1.LocalObjectReference `json:"additionalTrustBundle,omitempty"`
SecretEncryption *SecretEncryptionSpecApplyConfiguration `json:"secretEncryption,omitempty"`
FIPS *bool `json:"fips,omitempty"`
PausedUntil *string `json:"pausedUntil,omitempty"`
OLMCatalogPlacement *hypershiftv1beta1.OLMCatalogPlacement `json:"olmCatalogPlacement,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
}
// HostedClusterSpecApplyConfiguration constructs an declarative configuration of the HostedClusterSpec type for use with
// apply.
func HostedClusterSpec() *HostedClusterSpecApplyConfiguration {
return &HostedClusterSpecApplyConfiguration{}
}
// WithRelease sets the Release field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Release field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithRelease(value *ReleaseApplyConfiguration) *HostedClusterSpecApplyConfiguration {
b.Release = value
return b
}
// WithControlPlaneRelease sets the ControlPlaneRelease field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ControlPlaneRelease field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithControlPlaneRelease(value *ReleaseApplyConfiguration) *HostedClusterSpecApplyConfiguration {
b.ControlPlaneRelease = value
return b
}
// WithClusterID sets the ClusterID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ClusterID field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithClusterID(value string) *HostedClusterSpecApplyConfiguration {
b.ClusterID = &value
return b
}
// WithUpdateService sets the UpdateService field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the UpdateService field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithUpdateService(value v1.URL) *HostedClusterSpecApplyConfiguration {
b.UpdateService = &value
return b
}
// WithChannel sets the Channel field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Channel field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithChannel(value string) *HostedClusterSpecApplyConfiguration {
b.Channel = &value
return b
}
// WithInfraID sets the InfraID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the InfraID field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithInfraID(value string) *HostedClusterSpecApplyConfiguration {
b.InfraID = &value
return b
}
// WithPlatform sets the Platform field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Platform field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithPlatform(value *PlatformSpecApplyConfiguration) *HostedClusterSpecApplyConfiguration {
b.Platform = value
return b
}
// WithControllerAvailabilityPolicy sets the ControllerAvailabilityPolicy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ControllerAvailabilityPolicy field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithControllerAvailabilityPolicy(value hypershiftv1beta1.AvailabilityPolicy) *HostedClusterSpecApplyConfiguration {
b.ControllerAvailabilityPolicy = &value
return b
}
// WithInfrastructureAvailabilityPolicy sets the InfrastructureAvailabilityPolicy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the InfrastructureAvailabilityPolicy field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithInfrastructureAvailabilityPolicy(value hypershiftv1beta1.AvailabilityPolicy) *HostedClusterSpecApplyConfiguration {
b.InfrastructureAvailabilityPolicy = &value
return b
}
// WithDNS sets the DNS field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DNS field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithDNS(value *DNSSpecApplyConfiguration) *HostedClusterSpecApplyConfiguration {
b.DNS = value
return b
}
// WithNetworking sets the Networking field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Networking field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithNetworking(value *ClusterNetworkingApplyConfiguration) *HostedClusterSpecApplyConfiguration {
b.Networking = value
return b
}
// WithAutoscaling sets the Autoscaling field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Autoscaling field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithAutoscaling(value *ClusterAutoscalingApplyConfiguration) *HostedClusterSpecApplyConfiguration {
b.Autoscaling = value
return b
}
// WithEtcd sets the Etcd field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Etcd field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithEtcd(value *EtcdSpecApplyConfiguration) *HostedClusterSpecApplyConfiguration {
b.Etcd = value
return b
}
// WithServices adds the given value to the Services field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Services field.
func (b *HostedClusterSpecApplyConfiguration) WithServices(values ...*ServicePublishingStrategyMappingApplyConfiguration) *HostedClusterSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithServices")
}
b.Services = append(b.Services, *values[i])
}
return b
}
// WithPullSecret sets the PullSecret field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the PullSecret field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithPullSecret(value corev1.LocalObjectReference) *HostedClusterSpecApplyConfiguration {
b.PullSecret = &value
return b
}
// WithSSHKey sets the SSHKey field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the SSHKey field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithSSHKey(value corev1.LocalObjectReference) *HostedClusterSpecApplyConfiguration {
b.SSHKey = &value
return b
}
// WithIssuerURL sets the IssuerURL field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the IssuerURL field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithIssuerURL(value string) *HostedClusterSpecApplyConfiguration {
b.IssuerURL = &value
return b
}
// WithServiceAccountSigningKey sets the ServiceAccountSigningKey field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ServiceAccountSigningKey field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithServiceAccountSigningKey(value corev1.LocalObjectReference) *HostedClusterSpecApplyConfiguration {
b.ServiceAccountSigningKey = &value
return b
}
// WithConfiguration sets the Configuration field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Configuration field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithConfiguration(value *ClusterConfigurationApplyConfiguration) *HostedClusterSpecApplyConfiguration {
b.Configuration = value
return b
}
// WithAuditWebhook sets the AuditWebhook field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the AuditWebhook field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithAuditWebhook(value corev1.LocalObjectReference) *HostedClusterSpecApplyConfiguration {
b.AuditWebhook = &value
return b
}
// WithImageContentSources adds the given value to the ImageContentSources field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the ImageContentSources field.
func (b *HostedClusterSpecApplyConfiguration) WithImageContentSources(values ...*ImageContentSourceApplyConfiguration) *HostedClusterSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithImageContentSources")
}
b.ImageContentSources = append(b.ImageContentSources, *values[i])
}
return b
}
// WithAdditionalTrustBundle sets the AdditionalTrustBundle field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the AdditionalTrustBundle field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithAdditionalTrustBundle(value corev1.LocalObjectReference) *HostedClusterSpecApplyConfiguration {
b.AdditionalTrustBundle = &value
return b
}
// WithSecretEncryption sets the SecretEncryption field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the SecretEncryption field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithSecretEncryption(value *SecretEncryptionSpecApplyConfiguration) *HostedClusterSpecApplyConfiguration {
b.SecretEncryption = value
return b
}
// WithFIPS sets the FIPS field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the FIPS field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithFIPS(value bool) *HostedClusterSpecApplyConfiguration {
b.FIPS = &value
return b
}
// WithPausedUntil sets the PausedUntil field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the PausedUntil field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithPausedUntil(value string) *HostedClusterSpecApplyConfiguration {
b.PausedUntil = &value
return b
}
// WithOLMCatalogPlacement sets the OLMCatalogPlacement field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the OLMCatalogPlacement field is set to the value of the last call.
func (b *HostedClusterSpecApplyConfiguration) WithOLMCatalogPlacement(value hypershiftv1beta1.OLMCatalogPlacement) *HostedClusterSpecApplyConfiguration {
b.OLMCatalogPlacement = &value
return b
}
// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the NodeSelector field,
// overwriting an existing map entries in NodeSelector field with the same key.
func (b *HostedClusterSpecApplyConfiguration) WithNodeSelector(entries map[string]string) *HostedClusterSpecApplyConfiguration {
if b.NodeSelector == nil && len(entries) > 0 {
b.NodeSelector = make(map[string]string, len(entries))
}
for k, v := range entries {
b.NodeSelector[k] = v
}
return b
}