-
Notifications
You must be signed in to change notification settings - Fork 197
/
v2_cluster_update_params.go
797 lines (618 loc) · 24 KB
/
v2_cluster_update_params.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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"encoding/json"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// V2ClusterUpdateParams v2 cluster update params
//
// swagger:model v2-cluster-update-params
type V2ClusterUpdateParams struct {
// A comma-separated list of NTP sources (name or IP) going to be added to all the hosts.
AdditionalNtpSource *string `json:"additional_ntp_source,omitempty"`
// The domain name used to reach the OpenShift cluster API.
APIVipDNSName *string `json:"api_vip_dns_name,omitempty"`
// The virtual IPs used to reach the OpenShift cluster's API. Enter one IP address for single-stack clusters, or up to two for dual-stack clusters (at most one IP address per IP stack used). The order of stacks should be the same as order of subnets in Cluster Networks, Service Networks, and Machine Networks.
APIVips []*APIVip `json:"api_vips"`
// Base domain of the cluster. All DNS records must be sub-domains of this base and include the cluster name.
BaseDNSDomain *string `json:"base_dns_domain,omitempty"`
// IP address block from which Pod IPs are allocated. This block must not overlap with existing physical networks. These IP addresses are used for the Pod network, and if you need to access the Pods from an external network, configure load balancers and routers to manage the traffic.
// Pattern: ^(?:(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3}\/(?:(?:[0-9])|(?:[1-2][0-9])|(?:3[0-2])))|(?:(?:[0-9a-fA-F]*:[0-9a-fA-F]*){2,})/(?:(?:[0-9])|(?:[1-9][0-9])|(?:1[0-1][0-9])|(?:12[0-8])))$
ClusterNetworkCidr *string `json:"cluster_network_cidr,omitempty"`
// The subnet prefix length to assign to each individual node. For example, if clusterNetworkHostPrefix is set to 23, then each node is assigned a /23 subnet out of the given cidr (clusterNetworkCIDR), which allows for 510 (2^(32 - 23) - 2) pod IPs addresses. If you are required to provide access to nodes from an external network, configure load balancers and routers to manage the traffic.
// Maximum: 128
// Minimum: 1
ClusterNetworkHostPrefix *int64 `json:"cluster_network_host_prefix,omitempty"`
// Cluster networks that are associated with this cluster.
ClusterNetworks []*ClusterNetwork `json:"cluster_networks"`
// Installation disks encryption mode and host roles to be applied.
DiskEncryption *DiskEncryption `json:"disk_encryption,omitempty" gorm:"embedded;embeddedPrefix:disk_encryption_"`
// A proxy URL to use for creating HTTP connections outside the cluster.
// http://\<username\>:\<pswd\>@\<ip\>:\<port\>
//
HTTPProxy *string `json:"http_proxy,omitempty"`
// A proxy URL to use for creating HTTPS connections outside the cluster.
// http://\<username\>:\<pswd\>@\<ip\>:\<port\>
//
HTTPSProxy *string `json:"https_proxy,omitempty"`
// Enable/disable hyperthreading on master nodes, worker nodes, or all nodes.
// Enum: [masters workers all none]
Hyperthreading *string `json:"hyperthreading,omitempty"`
// Explicit ignition endpoint overrides the default ignition endpoint.
IgnitionEndpoint *IgnitionEndpoint `json:"ignition_endpoint,omitempty" gorm:"embedded;embeddedPrefix:ignition_endpoint_"`
// The virtual IPs used for cluster ingress traffic. Enter one IP address for single-stack clusters, or up to two for dual-stack clusters (at most one IP address per IP stack used). The order of stacks should be the same as order of subnets in Cluster Networks, Service Networks, and Machine Networks.
IngressVips []*IngressVip `json:"ingress_vips"`
// A CIDR that all hosts belonging to the cluster should have an interfaces with IP address that belongs to this CIDR. The api_vip belongs to this CIDR.
// Pattern: ^(?:(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3}\/(?:(?:[0-9])|(?:[1-2][0-9])|(?:3[0-2])))|(?:(?:[0-9a-fA-F]*:[0-9a-fA-F]*){2,})/(?:(?:[0-9])|(?:[1-9][0-9])|(?:1[0-1][0-9])|(?:12[0-8])))$
MachineNetworkCidr *string `json:"machine_network_cidr,omitempty"`
// Machine networks that are associated with this cluster.
MachineNetworks []*MachineNetwork `json:"machine_networks"`
// OpenShift cluster name.
// Max Length: 54
// Min Length: 1
Name *string `json:"name,omitempty"`
// The desired network type used.
// Enum: [OpenShiftSDN OVNKubernetes]
NetworkType *string `json:"network_type,omitempty"`
// An "*" or a comma-separated list of destination domain names, domains, IP addresses, or other network CIDRs to exclude from proxying.
NoProxy *string `json:"no_proxy,omitempty"`
// List of OLM operators to be installed.
OlmOperators []*OperatorCreateParams `json:"olm_operators"`
// platform
Platform *Platform `json:"platform,omitempty" gorm:"embedded;embeddedPrefix:platform_"`
// The pull secret obtained from Red Hat OpenShift Cluster Manager at console.redhat.com/openshift/install/pull-secret.
PullSecret *string `json:"pull_secret,omitempty"`
// Schedule workloads on masters
SchedulableMasters *bool `json:"schedulable_masters,omitempty"`
// The IP address pool to use for service IP addresses. You can enter only one IP address pool. If you need to access the services from an external network, configure load balancers and routers to manage the traffic.
// Pattern: ^(?:(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3}\/(?:(?:[0-9])|(?:[1-2][0-9])|(?:3[0-2])))|(?:(?:[0-9a-fA-F]*:[0-9a-fA-F]*){2,})/(?:(?:[0-9])|(?:[1-9][0-9])|(?:1[0-1][0-9])|(?:12[0-8])))$
ServiceNetworkCidr *string `json:"service_network_cidr,omitempty"`
// Service networks that are associated with this cluster.
ServiceNetworks []*ServiceNetwork `json:"service_networks"`
// SSH public key for debugging OpenShift nodes.
SSHPublicKey *string `json:"ssh_public_key,omitempty"`
// A comma-separated list of tags that are associated to the cluster.
Tags *string `json:"tags,omitempty"`
// (DEPRECATED) Indicate if the networking is managed by the user.
UserManagedNetworking *bool `json:"user_managed_networking,omitempty"`
// Indicate if virtual IP DHCP allocation mode is enabled.
VipDhcpAllocation *bool `json:"vip_dhcp_allocation,omitempty"`
}
// Validate validates this v2 cluster update params
func (m *V2ClusterUpdateParams) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAPIVips(formats); err != nil {
res = append(res, err)
}
if err := m.validateClusterNetworkCidr(formats); err != nil {
res = append(res, err)
}
if err := m.validateClusterNetworkHostPrefix(formats); err != nil {
res = append(res, err)
}
if err := m.validateClusterNetworks(formats); err != nil {
res = append(res, err)
}
if err := m.validateDiskEncryption(formats); err != nil {
res = append(res, err)
}
if err := m.validateHyperthreading(formats); err != nil {
res = append(res, err)
}
if err := m.validateIgnitionEndpoint(formats); err != nil {
res = append(res, err)
}
if err := m.validateIngressVips(formats); err != nil {
res = append(res, err)
}
if err := m.validateMachineNetworkCidr(formats); err != nil {
res = append(res, err)
}
if err := m.validateMachineNetworks(formats); err != nil {
res = append(res, err)
}
if err := m.validateName(formats); err != nil {
res = append(res, err)
}
if err := m.validateNetworkType(formats); err != nil {
res = append(res, err)
}
if err := m.validateOlmOperators(formats); err != nil {
res = append(res, err)
}
if err := m.validatePlatform(formats); err != nil {
res = append(res, err)
}
if err := m.validateServiceNetworkCidr(formats); err != nil {
res = append(res, err)
}
if err := m.validateServiceNetworks(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *V2ClusterUpdateParams) validateAPIVips(formats strfmt.Registry) error {
if swag.IsZero(m.APIVips) { // not required
return nil
}
for i := 0; i < len(m.APIVips); i++ {
if swag.IsZero(m.APIVips[i]) { // not required
continue
}
if m.APIVips[i] != nil {
if err := m.APIVips[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("api_vips" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("api_vips" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *V2ClusterUpdateParams) validateClusterNetworkCidr(formats strfmt.Registry) error {
if swag.IsZero(m.ClusterNetworkCidr) { // not required
return nil
}
if err := validate.Pattern("cluster_network_cidr", "body", *m.ClusterNetworkCidr, `^(?:(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3}\/(?:(?:[0-9])|(?:[1-2][0-9])|(?:3[0-2])))|(?:(?:[0-9a-fA-F]*:[0-9a-fA-F]*){2,})/(?:(?:[0-9])|(?:[1-9][0-9])|(?:1[0-1][0-9])|(?:12[0-8])))$`); err != nil {
return err
}
return nil
}
func (m *V2ClusterUpdateParams) validateClusterNetworkHostPrefix(formats strfmt.Registry) error {
if swag.IsZero(m.ClusterNetworkHostPrefix) { // not required
return nil
}
if err := validate.MinimumInt("cluster_network_host_prefix", "body", *m.ClusterNetworkHostPrefix, 1, false); err != nil {
return err
}
if err := validate.MaximumInt("cluster_network_host_prefix", "body", *m.ClusterNetworkHostPrefix, 128, false); err != nil {
return err
}
return nil
}
func (m *V2ClusterUpdateParams) validateClusterNetworks(formats strfmt.Registry) error {
if swag.IsZero(m.ClusterNetworks) { // not required
return nil
}
for i := 0; i < len(m.ClusterNetworks); i++ {
if swag.IsZero(m.ClusterNetworks[i]) { // not required
continue
}
if m.ClusterNetworks[i] != nil {
if err := m.ClusterNetworks[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cluster_networks" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("cluster_networks" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *V2ClusterUpdateParams) validateDiskEncryption(formats strfmt.Registry) error {
if swag.IsZero(m.DiskEncryption) { // not required
return nil
}
if m.DiskEncryption != nil {
if err := m.DiskEncryption.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("disk_encryption")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("disk_encryption")
}
return err
}
}
return nil
}
var v2ClusterUpdateParamsTypeHyperthreadingPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["masters","workers","all","none"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
v2ClusterUpdateParamsTypeHyperthreadingPropEnum = append(v2ClusterUpdateParamsTypeHyperthreadingPropEnum, v)
}
}
const (
// V2ClusterUpdateParamsHyperthreadingMasters captures enum value "masters"
V2ClusterUpdateParamsHyperthreadingMasters string = "masters"
// V2ClusterUpdateParamsHyperthreadingWorkers captures enum value "workers"
V2ClusterUpdateParamsHyperthreadingWorkers string = "workers"
// V2ClusterUpdateParamsHyperthreadingAll captures enum value "all"
V2ClusterUpdateParamsHyperthreadingAll string = "all"
// V2ClusterUpdateParamsHyperthreadingNone captures enum value "none"
V2ClusterUpdateParamsHyperthreadingNone string = "none"
)
// prop value enum
func (m *V2ClusterUpdateParams) validateHyperthreadingEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, v2ClusterUpdateParamsTypeHyperthreadingPropEnum, true); err != nil {
return err
}
return nil
}
func (m *V2ClusterUpdateParams) validateHyperthreading(formats strfmt.Registry) error {
if swag.IsZero(m.Hyperthreading) { // not required
return nil
}
// value enum
if err := m.validateHyperthreadingEnum("hyperthreading", "body", *m.Hyperthreading); err != nil {
return err
}
return nil
}
func (m *V2ClusterUpdateParams) validateIgnitionEndpoint(formats strfmt.Registry) error {
if swag.IsZero(m.IgnitionEndpoint) { // not required
return nil
}
if m.IgnitionEndpoint != nil {
if err := m.IgnitionEndpoint.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ignition_endpoint")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ignition_endpoint")
}
return err
}
}
return nil
}
func (m *V2ClusterUpdateParams) validateIngressVips(formats strfmt.Registry) error {
if swag.IsZero(m.IngressVips) { // not required
return nil
}
for i := 0; i < len(m.IngressVips); i++ {
if swag.IsZero(m.IngressVips[i]) { // not required
continue
}
if m.IngressVips[i] != nil {
if err := m.IngressVips[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ingress_vips" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ingress_vips" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *V2ClusterUpdateParams) validateMachineNetworkCidr(formats strfmt.Registry) error {
if swag.IsZero(m.MachineNetworkCidr) { // not required
return nil
}
if err := validate.Pattern("machine_network_cidr", "body", *m.MachineNetworkCidr, `^(?:(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3}\/(?:(?:[0-9])|(?:[1-2][0-9])|(?:3[0-2])))|(?:(?:[0-9a-fA-F]*:[0-9a-fA-F]*){2,})/(?:(?:[0-9])|(?:[1-9][0-9])|(?:1[0-1][0-9])|(?:12[0-8])))$`); err != nil {
return err
}
return nil
}
func (m *V2ClusterUpdateParams) validateMachineNetworks(formats strfmt.Registry) error {
if swag.IsZero(m.MachineNetworks) { // not required
return nil
}
for i := 0; i < len(m.MachineNetworks); i++ {
if swag.IsZero(m.MachineNetworks[i]) { // not required
continue
}
if m.MachineNetworks[i] != nil {
if err := m.MachineNetworks[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("machine_networks" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("machine_networks" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *V2ClusterUpdateParams) validateName(formats strfmt.Registry) error {
if swag.IsZero(m.Name) { // not required
return nil
}
if err := validate.MinLength("name", "body", *m.Name, 1); err != nil {
return err
}
if err := validate.MaxLength("name", "body", *m.Name, 54); err != nil {
return err
}
return nil
}
var v2ClusterUpdateParamsTypeNetworkTypePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["OpenShiftSDN","OVNKubernetes"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
v2ClusterUpdateParamsTypeNetworkTypePropEnum = append(v2ClusterUpdateParamsTypeNetworkTypePropEnum, v)
}
}
const (
// V2ClusterUpdateParamsNetworkTypeOpenShiftSDN captures enum value "OpenShiftSDN"
V2ClusterUpdateParamsNetworkTypeOpenShiftSDN string = "OpenShiftSDN"
// V2ClusterUpdateParamsNetworkTypeOVNKubernetes captures enum value "OVNKubernetes"
V2ClusterUpdateParamsNetworkTypeOVNKubernetes string = "OVNKubernetes"
)
// prop value enum
func (m *V2ClusterUpdateParams) validateNetworkTypeEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, v2ClusterUpdateParamsTypeNetworkTypePropEnum, true); err != nil {
return err
}
return nil
}
func (m *V2ClusterUpdateParams) validateNetworkType(formats strfmt.Registry) error {
if swag.IsZero(m.NetworkType) { // not required
return nil
}
// value enum
if err := m.validateNetworkTypeEnum("network_type", "body", *m.NetworkType); err != nil {
return err
}
return nil
}
func (m *V2ClusterUpdateParams) validateOlmOperators(formats strfmt.Registry) error {
if swag.IsZero(m.OlmOperators) { // not required
return nil
}
for i := 0; i < len(m.OlmOperators); i++ {
if swag.IsZero(m.OlmOperators[i]) { // not required
continue
}
if m.OlmOperators[i] != nil {
if err := m.OlmOperators[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("olm_operators" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("olm_operators" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *V2ClusterUpdateParams) validatePlatform(formats strfmt.Registry) error {
if swag.IsZero(m.Platform) { // not required
return nil
}
if m.Platform != nil {
if err := m.Platform.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("platform")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("platform")
}
return err
}
}
return nil
}
func (m *V2ClusterUpdateParams) validateServiceNetworkCidr(formats strfmt.Registry) error {
if swag.IsZero(m.ServiceNetworkCidr) { // not required
return nil
}
if err := validate.Pattern("service_network_cidr", "body", *m.ServiceNetworkCidr, `^(?:(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3}\/(?:(?:[0-9])|(?:[1-2][0-9])|(?:3[0-2])))|(?:(?:[0-9a-fA-F]*:[0-9a-fA-F]*){2,})/(?:(?:[0-9])|(?:[1-9][0-9])|(?:1[0-1][0-9])|(?:12[0-8])))$`); err != nil {
return err
}
return nil
}
func (m *V2ClusterUpdateParams) validateServiceNetworks(formats strfmt.Registry) error {
if swag.IsZero(m.ServiceNetworks) { // not required
return nil
}
for i := 0; i < len(m.ServiceNetworks); i++ {
if swag.IsZero(m.ServiceNetworks[i]) { // not required
continue
}
if m.ServiceNetworks[i] != nil {
if err := m.ServiceNetworks[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("service_networks" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("service_networks" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this v2 cluster update params based on the context it is used
func (m *V2ClusterUpdateParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAPIVips(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateClusterNetworks(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateDiskEncryption(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateIgnitionEndpoint(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateIngressVips(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMachineNetworks(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateOlmOperators(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidatePlatform(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateServiceNetworks(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *V2ClusterUpdateParams) contextValidateAPIVips(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.APIVips); i++ {
if m.APIVips[i] != nil {
if err := m.APIVips[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("api_vips" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("api_vips" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *V2ClusterUpdateParams) contextValidateClusterNetworks(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.ClusterNetworks); i++ {
if m.ClusterNetworks[i] != nil {
if err := m.ClusterNetworks[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cluster_networks" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("cluster_networks" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *V2ClusterUpdateParams) contextValidateDiskEncryption(ctx context.Context, formats strfmt.Registry) error {
if m.DiskEncryption != nil {
if err := m.DiskEncryption.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("disk_encryption")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("disk_encryption")
}
return err
}
}
return nil
}
func (m *V2ClusterUpdateParams) contextValidateIgnitionEndpoint(ctx context.Context, formats strfmt.Registry) error {
if m.IgnitionEndpoint != nil {
if err := m.IgnitionEndpoint.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ignition_endpoint")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ignition_endpoint")
}
return err
}
}
return nil
}
func (m *V2ClusterUpdateParams) contextValidateIngressVips(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.IngressVips); i++ {
if m.IngressVips[i] != nil {
if err := m.IngressVips[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ingress_vips" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ingress_vips" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *V2ClusterUpdateParams) contextValidateMachineNetworks(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.MachineNetworks); i++ {
if m.MachineNetworks[i] != nil {
if err := m.MachineNetworks[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("machine_networks" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("machine_networks" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *V2ClusterUpdateParams) contextValidateOlmOperators(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.OlmOperators); i++ {
if m.OlmOperators[i] != nil {
if err := m.OlmOperators[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("olm_operators" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("olm_operators" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *V2ClusterUpdateParams) contextValidatePlatform(ctx context.Context, formats strfmt.Registry) error {
if m.Platform != nil {
if err := m.Platform.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("platform")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("platform")
}
return err
}
}
return nil
}
func (m *V2ClusterUpdateParams) contextValidateServiceNetworks(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.ServiceNetworks); i++ {
if m.ServiceNetworks[i] != nil {
if err := m.ServiceNetworks[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("service_networks" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("service_networks" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *V2ClusterUpdateParams) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *V2ClusterUpdateParams) UnmarshalBinary(b []byte) error {
var res V2ClusterUpdateParams
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}