Skip to content

Commit 29fb6a6

Browse files
committed
fix: Remove generic cluster config variable
This was never used anywhere.
1 parent 8909953 commit 29fb6a6

19 files changed

+682
-775
lines changed

api/v1alpha1/clusterconfig_types.go

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,13 @@ var (
4242
"0.0.0.0",
4343
}
4444

45-
//go:embed crds/caren.nutanix.com_genericclusterconfigs.yaml
46-
genericClusterConfigCRDDefinition []byte
4745
//go:embed crds/caren.nutanix.com_dockerclusterconfigs.yaml
4846
dockerClusterConfigCRDDefinition []byte
4947
//go:embed crds/caren.nutanix.com_awsclusterconfigs.yaml
5048
awsClusterConfigCRDDefinition []byte
5149
//go:embed crds/caren.nutanix.com_nutanixclusterconfigs.yaml
5250
nutanixClusterConfigCRDDefinition []byte
5351

54-
genericClusterConfigVariableSchema = variables.MustSchemaFromCRDYAML(
55-
genericClusterConfigCRDDefinition,
56-
)
5752
dockerClusterConfigVariableSchema = variables.MustSchemaFromCRDYAML(
5853
dockerClusterConfigCRDDefinition,
5954
)
@@ -90,6 +85,12 @@ type AWSClusterConfigSpec struct {
9085

9186
// +optional
9287
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"`
9394
}
9495

9596
// +kubebuilder:object:root=true
@@ -116,6 +117,17 @@ type DockerClusterConfigSpec struct {
116117

117118
// +optional
118119
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"`
119131
}
120132

121133
// +kubebuilder:object:root=true
@@ -142,21 +154,16 @@ type NutanixClusterConfigSpec struct {
142154

143155
// +optional
144156
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"`
153157

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])?)*$`
154165
// +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"`
160167
}
161168

162169
// GenericClusterConfigSpec defines the desired state of GenericClusterConfig.
@@ -172,14 +179,6 @@ type GenericClusterConfigSpec struct {
172179
// +optional
173180
Proxy *HTTPProxy `json:"proxy,omitempty"`
174181

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-
183182
// +optional
184183
ImageRegistries []ImageRegistry `json:"imageRegistries,omitempty"`
185184

@@ -287,6 +286,5 @@ func init() {
287286
&AWSClusterConfig{},
288287
&DockerClusterConfig{},
289288
&NutanixClusterConfig{},
290-
&GenericClusterConfig{},
291289
)
292290
}

api/v1alpha1/crds/caren.nutanix.com_awsclusterconfigs.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,8 @@ spec:
308308
type: object
309309
type: object
310310
extraAPIServerCertSANs:
311-
description: |-
312-
Subject Alternative Names for the API Server signing cert.
313-
For Docker are injected automatically.
314-
For Nutanix are injected automatically.
311+
description: Extra Subject Alternative Names for the API Server signing
312+
cert.
315313
items:
316314
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
317315
type: string

api/v1alpha1/crds/caren.nutanix.com_dockerclusterconfigs.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,12 @@ spec:
235235
type: object
236236
extraAPIServerCertSANs:
237237
description: |-
238-
Subject Alternative Names for the API Server signing cert.
239-
For Docker are injected automatically.
240-
For Nutanix are injected automatically.
238+
Extra Subject Alternative Names for the API Server signing cert.
239+
For the Nutanix provider, the following default SANs will always be added:
240+
- localhost
241+
- 127.0.0.1
242+
- 0.0.0.0
243+
- host.docker.internal
241244
items:
242245
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
243246
type: string

0 commit comments

Comments
 (0)