Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit 1970b45

Browse files
committed
refactor: remove unused types
1 parent 020ebdc commit 1970b45

File tree

3 files changed

+4
-279
lines changed

3 files changed

+4
-279
lines changed

api/v1alpha1/nutanix_clusterconfig_types.go

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ type NutanixSpec struct {
1616

1717
// Nutanix Prism Central endpoint configuration.
1818
PrismCentralEndpoint NutanixPrismCentralEndpointSpec `json:"prismCentralEndpoint"`
19-
20-
// Configures failure domains information for the Nutanix platform.
21-
// When set, the failure domains defined here may be used to spread Machines across
22-
// prism element clusters to improve fault tolerance of the cluster.
23-
FailureDomains []NutanixFailureDomain `json:"failureDomains"`
2419
}
2520

2621
func (NutanixSpec) VariableSchema() clusterv1.VariableSchema {
@@ -31,7 +26,6 @@ func (NutanixSpec) VariableSchema() clusterv1.VariableSchema {
3126
Properties: map[string]clusterv1.JSONSchemaProps{
3227
"controlPlaneEndpoint": ControlPlaneEndpointSpec{}.VariableSchema().OpenAPIV3Schema,
3328
"prismCentralEndpoint": NutanixPrismCentralEndpointSpec{}.VariableSchema().OpenAPIV3Schema,
34-
"failureDomains": NutanixFailureDomains{}.VariableSchema().OpenAPIV3Schema,
3529
},
3630
},
3731
}
@@ -108,54 +102,3 @@ func (NutanixPrismCentralEndpointSpec) VariableSchema() clusterv1.VariableSchema
108102
},
109103
}
110104
}
111-
112-
type NutanixFailureDomains []NutanixFailureDomain
113-
114-
func (NutanixFailureDomains) VariableSchema() clusterv1.VariableSchema {
115-
resourceSchema := NutanixFailureDomain{}.VariableSchema().OpenAPIV3Schema
116-
117-
return clusterv1.VariableSchema{
118-
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
119-
Description: "Nutanix failure domains",
120-
Type: "array",
121-
Items: &resourceSchema,
122-
},
123-
}
124-
}
125-
126-
type NutanixFailureDomain capxv1.NutanixFailureDomain
127-
128-
func (NutanixFailureDomain) VariableSchema() clusterv1.VariableSchema {
129-
return clusterv1.VariableSchema{
130-
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
131-
Description: "Nutanix Failure Domain",
132-
Type: "object",
133-
Properties: map[string]clusterv1.JSONSchemaProps{
134-
"name": {
135-
Description: "name of failure domain",
136-
Type: "string",
137-
},
138-
"cluster": NutanixResourceIdentifier{}.VariableSchema().OpenAPIV3Schema,
139-
"subnets": NutanixResourceIdentifiers{}.VariableSchema().OpenAPIV3Schema,
140-
"controlPlane": {
141-
Description: "indicates if a failure domain is suited for control plane nodes",
142-
Type: "boolean",
143-
},
144-
},
145-
},
146-
}
147-
}
148-
149-
type NutanixResourceIdentifiers []NutanixResourceIdentifier
150-
151-
func (NutanixResourceIdentifiers) VariableSchema() clusterv1.VariableSchema {
152-
resourceSchema := NutanixResourceIdentifier{}.VariableSchema().OpenAPIV3Schema
153-
154-
return clusterv1.VariableSchema{
155-
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
156-
Description: "Nutanix resource identifier",
157-
Type: "array",
158-
Items: &resourceSchema,
159-
},
160-
}
161-
}

api/v1alpha1/nutanix_node_types.go

Lines changed: 4 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,12 @@ type NutanixNodeSpec struct {
3535
// or using the prism_central API.
3636
Subnets NutanixResourceIdentifiers `json:"subnet"`
3737

38-
// List of categories that need to be added to the machines. Categories must already exist in Prism Central
39-
AdditionalCategories []NutanixCategoryIdentifier `json:"additionalCategories,omitempty"`
40-
41-
// Add the machine resources to a Prism Central project
42-
Project NutanixResourceIdentifier `json:"project,omitempty"`
43-
4438
// Defines the boot type of the virtual machine. Only supports UEFI and Legacy
4539
BootType NutanixBootType `json:"bootType,omitempty"`
4640

4741
// systemDiskSize is size (in Quantity format) of the system disk of the VM
4842
// The minimum systemDiskSize is 20Gi bytes
4943
SystemDiskSize string `json:"systemDiskSize"`
50-
51-
// List of GPU devices that need to be added to the machines.
52-
GPUs []NutanixGPU `json:"gpus,omitempty"`
5344
}
5445

5546
func (NutanixNodeSpec) VariableSchema() clusterv1.VariableSchema {
@@ -78,9 +69,6 @@ func (NutanixNodeSpec) VariableSchema() clusterv1.VariableSchema {
7869
Description: "systemDiskSize is size (in Quantity format) of the system disk of the VM eg. 20Gi",
7970
Type: "string",
8071
},
81-
"project": NutanixResourceIdentifier{}.VariableSchema().OpenAPIV3Schema,
82-
"additionalCategories": NutanixCategoryIdentifiers{}.VariableSchema().OpenAPIV3Schema,
83-
"gpus": NutanixGPUs{}.VariableSchema().OpenAPIV3Schema,
8472
},
8573
},
8674
}
@@ -110,18 +98,6 @@ func (NutanixBootType) VariableSchema() clusterv1.VariableSchema {
11098
}
11199
}
112100

113-
// NutanixGPUIdentifierType is an enumeration of different resource identifier types for GPU entities.
114-
type NutanixGPUIdentifierType capxv1.NutanixGPUIdentifierType
115-
116-
func (NutanixGPUIdentifierType) VariableSchema() clusterv1.VariableSchema {
117-
return clusterv1.VariableSchema{
118-
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
119-
Type: "string",
120-
Description: "NutanixGPUIdentifierType is an enumeration of different resource identifier types for GPU entities.",
121-
},
122-
}
123-
}
124-
125101
type NutanixResourceIdentifier capxv1.NutanixResourceIdentifier
126102

127103
func (NutanixResourceIdentifier) VariableSchema() clusterv1.VariableSchema {
@@ -144,71 +120,14 @@ func (NutanixResourceIdentifier) VariableSchema() clusterv1.VariableSchema {
144120
}
145121
}
146122

147-
type NutanixCategoryIdentifier capxv1.NutanixCategoryIdentifier
148-
149-
func (NutanixCategoryIdentifier) VariableSchema() clusterv1.VariableSchema {
150-
return clusterv1.VariableSchema{
151-
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
152-
Description: "Nutanix Category Identifier",
153-
Type: "object",
154-
Properties: map[string]clusterv1.JSONSchemaProps{
155-
"key": {
156-
Type: "string",
157-
Description: "key is the Key of category in PC.",
158-
},
159-
"value": {
160-
Type: "string",
161-
Description: "value is the category value linked to the category key in PC",
162-
},
163-
},
164-
},
165-
}
166-
}
167-
168-
type NutanixCategoryIdentifiers []NutanixCategoryIdentifier
169-
170-
func (NutanixCategoryIdentifiers) VariableSchema() clusterv1.VariableSchema {
171-
resourceSchema := NutanixCategoryIdentifier{}.VariableSchema().OpenAPIV3Schema
172-
173-
return clusterv1.VariableSchema{
174-
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
175-
Description: "Nutanix category identifier",
176-
Type: "array",
177-
Items: &resourceSchema,
178-
},
179-
}
180-
}
181-
182-
type NutanixGPU capxv1.NutanixGPU
183-
184-
func (NutanixGPU) VariableSchema() clusterv1.VariableSchema {
185-
return clusterv1.VariableSchema{
186-
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
187-
Description: "Nutanix GPU type",
188-
Type: "object",
189-
Properties: map[string]clusterv1.JSONSchemaProps{
190-
"type": NutanixGPUIdentifierType("name").VariableSchema().OpenAPIV3Schema,
191-
"deviceID": {
192-
Type: "int64",
193-
Description: "deviceID is the id of the GPU entity.",
194-
},
195-
"name": {
196-
Type: "string",
197-
Description: "name is the GPU name.",
198-
},
199-
},
200-
},
201-
}
202-
}
203-
204-
type NutanixGPUs []NutanixGPU
123+
type NutanixResourceIdentifiers []NutanixResourceIdentifier
205124

206-
func (NutanixGPUs) VariableSchema() clusterv1.VariableSchema {
207-
resourceSchema := NutanixGPU{}.VariableSchema().OpenAPIV3Schema
125+
func (NutanixResourceIdentifiers) VariableSchema() clusterv1.VariableSchema {
126+
resourceSchema := NutanixResourceIdentifier{}.VariableSchema().OpenAPIV3Schema
208127

209128
return clusterv1.VariableSchema{
210129
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
211-
Description: "Nutanix GPU identifier",
130+
Description: "Nutanix resource identifier",
212131
Type: "array",
213132
Items: &resourceSchema,
214133
},

api/v1alpha1/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)