forked from kubevirt/hyperconverged-cluster-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzz_generated.defaults.go
174 lines (166 loc) · 6.01 KB
/
zz_generated.defaults.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
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
* This file is part of the KubeVirt project
*
* 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.
*
* Copyright 2025 Red Hat, Inc.
*
*/
// Code generated by defaulter-gen. DO NOT EDIT.
package v1beta1
import (
"encoding/json"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// RegisterDefaults adds defaulters functions to the given scheme.
// Public to allow building arbitrary schemes.
// All generated defaulters are covering - they call all nested defaulters.
func RegisterDefaults(scheme *runtime.Scheme) error {
scheme.AddTypeDefaultingFunc(&HyperConverged{}, func(obj interface{}) { SetObjectDefaults_HyperConverged(obj.(*HyperConverged)) })
scheme.AddTypeDefaultingFunc(&HyperConvergedList{}, func(obj interface{}) { SetObjectDefaults_HyperConvergedList(obj.(*HyperConvergedList)) })
return nil
}
func SetObjectDefaults_HyperConverged(in *HyperConverged) {
if in.Spec.FeatureGates.DownwardMetrics == nil {
var ptrVar1 bool = false
in.Spec.FeatureGates.DownwardMetrics = &ptrVar1
}
if in.Spec.FeatureGates.DeployVMConsoleProxy == nil {
var ptrVar1 bool = false
in.Spec.FeatureGates.DeployVMConsoleProxy = &ptrVar1
}
if in.Spec.FeatureGates.DeployKubeSecondaryDNS == nil {
var ptrVar1 bool = false
in.Spec.FeatureGates.DeployKubeSecondaryDNS = &ptrVar1
}
if in.Spec.FeatureGates.DisableMDevConfiguration == nil {
var ptrVar1 bool = false
in.Spec.FeatureGates.DisableMDevConfiguration = &ptrVar1
}
if in.Spec.FeatureGates.PersistentReservation == nil {
var ptrVar1 bool = false
in.Spec.FeatureGates.PersistentReservation = &ptrVar1
}
if in.Spec.FeatureGates.AlignCPUs == nil {
var ptrVar1 bool = false
in.Spec.FeatureGates.AlignCPUs = &ptrVar1
}
if in.Spec.FeatureGates.EnableApplicationAwareQuota == nil {
var ptrVar1 bool = false
in.Spec.FeatureGates.EnableApplicationAwareQuota = &ptrVar1
}
if in.Spec.LiveMigrationConfig.ParallelMigrationsPerCluster == nil {
var ptrVar1 uint32 = 5
in.Spec.LiveMigrationConfig.ParallelMigrationsPerCluster = &ptrVar1
}
if in.Spec.LiveMigrationConfig.ParallelOutboundMigrationsPerNode == nil {
var ptrVar1 uint32 = 2
in.Spec.LiveMigrationConfig.ParallelOutboundMigrationsPerNode = &ptrVar1
}
if in.Spec.LiveMigrationConfig.CompletionTimeoutPerGiB == nil {
var ptrVar1 int64 = 150
in.Spec.LiveMigrationConfig.CompletionTimeoutPerGiB = &ptrVar1
}
if in.Spec.LiveMigrationConfig.ProgressTimeout == nil {
var ptrVar1 int64 = 150
in.Spec.LiveMigrationConfig.ProgressTimeout = &ptrVar1
}
if in.Spec.LiveMigrationConfig.AllowAutoConverge == nil {
var ptrVar1 bool = false
in.Spec.LiveMigrationConfig.AllowAutoConverge = &ptrVar1
}
if in.Spec.LiveMigrationConfig.AllowPostCopy == nil {
var ptrVar1 bool = false
in.Spec.LiveMigrationConfig.AllowPostCopy = &ptrVar1
}
if in.Spec.CertConfig.CA.Duration == nil {
if err := json.Unmarshal([]byte(`"48h0m0s"`), &in.Spec.CertConfig.CA.Duration); err != nil {
panic(err)
}
}
if in.Spec.CertConfig.CA.RenewBefore == nil {
if err := json.Unmarshal([]byte(`"24h0m0s"`), &in.Spec.CertConfig.CA.RenewBefore); err != nil {
panic(err)
}
}
if in.Spec.CertConfig.Server.Duration == nil {
if err := json.Unmarshal([]byte(`"24h0m0s"`), &in.Spec.CertConfig.Server.Duration); err != nil {
panic(err)
}
}
if in.Spec.CertConfig.Server.RenewBefore == nil {
if err := json.Unmarshal([]byte(`"12h0m0s"`), &in.Spec.CertConfig.Server.RenewBefore); err != nil {
panic(err)
}
}
if in.Spec.ResourceRequirements != nil {
if in.Spec.ResourceRequirements.VmiCPUAllocationRatio == nil {
var ptrVar1 int = 10
in.Spec.ResourceRequirements.VmiCPUAllocationRatio = &ptrVar1
}
}
if in.Spec.WorkloadUpdateStrategy.WorkloadUpdateMethods == nil {
if err := json.Unmarshal([]byte(`["LiveMigrate"]`), &in.Spec.WorkloadUpdateStrategy.WorkloadUpdateMethods); err != nil {
panic(err)
}
}
if in.Spec.WorkloadUpdateStrategy.BatchEvictionSize == nil {
var ptrVar1 int = 10
in.Spec.WorkloadUpdateStrategy.BatchEvictionSize = &ptrVar1
}
if in.Spec.WorkloadUpdateStrategy.BatchEvictionInterval == nil {
if err := json.Unmarshal([]byte(`"1m0s"`), &in.Spec.WorkloadUpdateStrategy.BatchEvictionInterval); err != nil {
panic(err)
}
}
if in.Spec.UninstallStrategy == "" {
in.Spec.UninstallStrategy = "BlockUninstallIfWorkloadsExist"
}
if in.Spec.VirtualMachineOptions == nil {
if err := json.Unmarshal([]byte(`{"disableFreePageReporting": false, "disableSerialConsoleLog": false}`), &in.Spec.VirtualMachineOptions); err != nil {
panic(err)
}
}
if in.Spec.VirtualMachineOptions != nil {
if in.Spec.VirtualMachineOptions.DisableFreePageReporting == nil {
var ptrVar1 bool = false
in.Spec.VirtualMachineOptions.DisableFreePageReporting = &ptrVar1
}
if in.Spec.VirtualMachineOptions.DisableSerialConsoleLog == nil {
var ptrVar1 bool = false
in.Spec.VirtualMachineOptions.DisableSerialConsoleLog = &ptrVar1
}
}
if in.Spec.HigherWorkloadDensity == nil {
if err := json.Unmarshal([]byte(`{"memoryOvercommitPercentage": 100}`), &in.Spec.HigherWorkloadDensity); err != nil {
panic(err)
}
}
if in.Spec.HigherWorkloadDensity != nil {
if in.Spec.HigherWorkloadDensity.MemoryOvercommitPercentage == 0 {
in.Spec.HigherWorkloadDensity.MemoryOvercommitPercentage = 100
}
}
if in.Spec.EnableCommonBootImageImport == nil {
var ptrVar1 bool = true
in.Spec.EnableCommonBootImageImport = &ptrVar1
}
}
func SetObjectDefaults_HyperConvergedList(in *HyperConvergedList) {
for i := range in.Items {
a := &in.Items[i]
SetObjectDefaults_HyperConverged(a)
}
}