@@ -5,12 +5,31 @@ package clusterconfig
5
5
6
6
import carenv1 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/v1alpha1"
7
7
8
+ // ClusterConfig is a type to be used internally to simplify the handling of cluster configurations for different
9
+ // providers. It is not meant to be used as a CRD.
10
+ // By including all the possible configurations for all the providers, we can easily switch between providers in code
11
+ // without type assertions/switches and avoids passing around `interface{}` or `any` types.
12
+ // Every provider-specific cluster config variable will successfully unmarshal to this type and so it is safe to use
13
+ // this internally when a handler provides functionality for multiple providers but exhibits different behaviour per
14
+ // provider.
8
15
type ClusterConfig struct {
9
16
AWS * carenv1.AWSSpec `json:"aws,omitempty"`
10
17
11
- Docker * carenv1.AWSSpec `json:"doker ,omitempty"`
18
+ Docker * carenv1.DockerSpec `json:"docker ,omitempty"`
12
19
13
20
Nutanix * carenv1.NutanixSpec `json:"nutanix,omitempty"`
14
21
15
22
carenv1.GenericClusterConfigSpec `json:",inline"`
23
+
24
+ ExtraAPIServerCertSANs []string `json:"extraAPIServerCertSANs,omitempty"`
25
+
26
+ ControlPlane * ControlPlaneConfig `json:"controlPlane,omitempty"`
27
+ }
28
+
29
+ type ControlPlaneConfig struct {
30
+ AWS * carenv1.AWSControlPlaneNodeSpec `json:"aws,omitempty"`
31
+
32
+ Docker * carenv1.DockerNodeConfigSpec `json:"docker,omitempty"`
33
+
34
+ Nutanix * carenv1.NutanixNodeConfigSpec `json:"nutanix,omitempty"`
16
35
}
0 commit comments