@@ -42,18 +42,13 @@ var (
42
42
"0.0.0.0" ,
43
43
}
44
44
45
- //go:embed crds/caren.nutanix.com_genericclusterconfigs.yaml
46
- genericClusterConfigCRDDefinition []byte
47
45
//go:embed crds/caren.nutanix.com_dockerclusterconfigs.yaml
48
46
dockerClusterConfigCRDDefinition []byte
49
47
//go:embed crds/caren.nutanix.com_awsclusterconfigs.yaml
50
48
awsClusterConfigCRDDefinition []byte
51
49
//go:embed crds/caren.nutanix.com_nutanixclusterconfigs.yaml
52
50
nutanixClusterConfigCRDDefinition []byte
53
51
54
- genericClusterConfigVariableSchema = variables .MustSchemaFromCRDYAML (
55
- genericClusterConfigCRDDefinition ,
56
- )
57
52
dockerClusterConfigVariableSchema = variables .MustSchemaFromCRDYAML (
58
53
dockerClusterConfigCRDDefinition ,
59
54
)
@@ -90,6 +85,12 @@ type AWSClusterConfigSpec struct {
90
85
91
86
// +optional
92
87
ControlPlane * AWSNodeConfigSpec `json:"controlPlane,omitempty"`
88
+
89
+ // Extra Subject Alternative Names for the API Server signing cert.
90
+ // +kubebuilder:validation:UniqueItems=true
91
+ // +kubebuilder:validation:items:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
92
+ // +optional
93
+ ExtraAPIServerCertSANs []string `json:"extraAPIServerCertSANs,omitempty"`
93
94
}
94
95
95
96
// +kubebuilder:object:root=true
@@ -116,6 +117,17 @@ type DockerClusterConfigSpec struct {
116
117
117
118
// +optional
118
119
ControlPlane * DockerNodeConfigSpec `json:"controlPlane,omitempty"`
120
+
121
+ // Extra Subject Alternative Names for the API Server signing cert.
122
+ // For the Nutanix provider, the following default SANs will always be added:
123
+ // - localhost
124
+ // - 127.0.0.1
125
+ // - 0.0.0.0
126
+ // - host.docker.internal
127
+ // +kubebuilder:validation:UniqueItems=true
128
+ // +kubebuilder:validation:items:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
129
+ // +optional
130
+ ExtraAPIServerCertSANs []string `json:"extraAPIServerCertSANs,omitempty"`
119
131
}
120
132
121
133
// +kubebuilder:object:root=true
@@ -142,21 +154,16 @@ type NutanixClusterConfigSpec struct {
142
154
143
155
// +optional
144
156
ControlPlane * NutanixNodeConfigSpec `json:"controlPlane,omitempty"`
145
- }
146
-
147
- // +kubebuilder:object:root=true
148
-
149
- // GenericClusterConfig is the Schema for the clusterconfigs API.
150
- type GenericClusterConfig struct {
151
- metav1.TypeMeta `json:",inline"`
152
- metav1.ObjectMeta `json:"metadata,omitempty"`
153
157
158
+ // Subject Alternative Names for the API Server signing cert.
159
+ // For the Nutanix provider, the following default SANs will always be added:
160
+ // - localhost
161
+ // - 127.0.0.1
162
+ // - 0.0.0.0
163
+ // +kubebuilder:validation:UniqueItems=true
164
+ // +kubebuilder:validation:items:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
154
165
// +optional
155
- Spec GenericClusterConfigSpec `json:"spec,omitempty"`
156
- }
157
-
158
- func (s GenericClusterConfig ) VariableSchema () clusterv1.VariableSchema { //nolint:gocritic,lll // Passed by value for no potential side-effect.
159
- return genericClusterConfigVariableSchema
166
+ ExtraAPIServerCertSANs []string `json:"extraAPIServerCertSANs,omitempty"`
160
167
}
161
168
162
169
// GenericClusterConfigSpec defines the desired state of GenericClusterConfig.
@@ -172,14 +179,6 @@ type GenericClusterConfigSpec struct {
172
179
// +optional
173
180
Proxy * HTTPProxy `json:"proxy,omitempty"`
174
181
175
- // Subject Alternative Names for the API Server signing cert.
176
- // For Docker are injected automatically.
177
- // For Nutanix are injected automatically.
178
- // +kubebuilder:validation:UniqueItems=true
179
- // +kubebuilder:validation:items:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
180
- // +optional
181
- ExtraAPIServerCertSANs []string `json:"extraAPIServerCertSANs,omitempty"`
182
-
183
182
// +optional
184
183
ImageRegistries []ImageRegistry `json:"imageRegistries,omitempty"`
185
184
@@ -287,6 +286,5 @@ func init() {
287
286
& AWSClusterConfig {},
288
287
& DockerClusterConfig {},
289
288
& NutanixClusterConfig {},
290
- & GenericClusterConfig {},
291
289
)
292
290
}
0 commit comments