Skip to content

Commit 63c80b2

Browse files
committed
added cluster config variables
1 parent 2383635 commit 63c80b2

File tree

2 files changed

+107
-29
lines changed

2 files changed

+107
-29
lines changed

api/v1alpha1/nutanix_clusterconfig_types.go

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func (NutanixSpec) VariableSchema() clusterv1.VariableSchema {
2121
Properties: map[string]clusterv1.JSONSchemaProps{
2222
"prismCentralEndpoint": NutanixPrismCentralEndpointSpec{}.VariableSchema().OpenAPIV3Schema,
2323
"controlPlaneEndpoint": NutanixControlPlaneEndpointSpec{}.VariableSchema().OpenAPIV3Schema,
24-
// TODO "failureDomains": []NutanixFailureDomain{}.VariableSchema().OpenAPIV3Schema,
24+
"failureDomains": NutanixFailureDomains{}.VariableSchema().OpenAPIV3Schema,
2525
},
2626
},
2727
}
@@ -85,6 +85,20 @@ func (NutanixControlPlaneEndpointSpec) VariableSchema() clusterv1.VariableSchema
8585
}
8686
}
8787

88+
type NutanixFailureDomains []NutanixFailureDomain
89+
90+
func (NutanixFailureDomains) VariableSchema() clusterv1.VariableSchema {
91+
resourceSchema := NutanixFailureDomain{}.VariableSchema().OpenAPIV3Schema
92+
93+
return clusterv1.VariableSchema{
94+
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
95+
Description: "Nutanix failure domains",
96+
Type: "array",
97+
Items: &resourceSchema,
98+
},
99+
}
100+
}
101+
88102
type NutanixFailureDomain struct {
89103
// name defines the unique name of a failure domain.
90104
// Name is required and must be at most 64 characters in length.
@@ -112,16 +126,32 @@ func (NutanixFailureDomain) VariableSchema() clusterv1.VariableSchema {
112126
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
113127
Description: "Nutanix Failure Domain",
114128
Type: "object",
115-
Properties: map[string]clusterv1.JSONSchemaProps{
129+
Properties: map[string]clusterv1.JSONSchemaProps{
116130
"name": {
117131
Description: "name of failure domain",
118132
Type: "string",
119133
},
120-
"cluster": {
121-
Description: "",
122-
Type: "integer",
134+
"cluster": NutanixResourceIdentifier{}.VariableSchema().OpenAPIV3Schema,
135+
"subnets": NutanixResourceIdentifiers{}.VariableSchema().OpenAPIV3Schema,
136+
"controlPlane": {
137+
Description: "indicates if a failure domain is suited for control plane nodes",
138+
Type: "boolean",
123139
},
124-
},
140+
},
141+
},
142+
}
143+
}
144+
145+
type NutanixResourceIdentifiers []NutanixResourceIdentifier
146+
147+
func (NutanixResourceIdentifiers) VariableSchema() clusterv1.VariableSchema {
148+
resourceSchema := NutanixResourceIdentifier{}.VariableSchema().OpenAPIV3Schema
149+
150+
return clusterv1.VariableSchema{
151+
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
152+
Description: "Nutanix resource identifier",
153+
Type: "array",
154+
Items: &resourceSchema,
125155
},
126156
}
127157
}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 71 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)