Skip to content

Commit 11f32ae

Browse files
committed
fixup! feat: Add additionalCategories field to Nutanix machine details patch
Add additionalCategories to variables test
1 parent ff6a8a0 commit 11f32ae

File tree

4 files changed

+13
-36
lines changed

4 files changed

+13
-36
lines changed

api/v1alpha1/nutanix_node_types.go

+1-15
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ type NutanixMachineDetails struct {
5656
// List of categories that need to be added to the machines. Categories must already
5757
// exist in Prism Central. One category key can have more than one value.
5858
// +optional
59-
AdditionalCategories NutanixCategoryIdentifiers `json:"additionalCategories,omitempty"`
59+
AdditionalCategories []NutanixCategoryIdentifier `json:"additionalCategories,omitempty"`
6060

6161
// Defines the boot type of the virtual machine. Only supports UEFI and Legacy
6262
BootType NutanixBootType `json:"bootType,omitempty"`
@@ -221,17 +221,3 @@ func (NutanixCategoryIdentifier) VariableSchema() clusterv1.VariableSchema {
221221
},
222222
}
223223
}
224-
225-
type NutanixCategoryIdentifiers []NutanixCategoryIdentifier
226-
227-
func (NutanixCategoryIdentifiers) VariableSchema() clusterv1.VariableSchema {
228-
resourceSchema := NutanixCategoryIdentifier{}.VariableSchema().OpenAPIV3Schema
229-
230-
return clusterv1.VariableSchema{
231-
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
232-
Description: "Nutanix category identifiers",
233-
Type: "array",
234-
Items: &resourceSchema,
235-
},
236-
}
237-
}

api/v1alpha1/zz_generated.deepcopy.go

+1-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/handlers/nutanix/mutation/machinedetails/inject_control_plane_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var (
4141
Name: ptr.To("fake-subnet"),
4242
},
4343
},
44-
AdditionalCategories: v1alpha1.NutanixCategoryIdentifiers{
44+
AdditionalCategories: []v1alpha1.NutanixCategoryIdentifier{
4545
{
4646
Key: "fake-key",
4747
Value: "fake-value",

pkg/handlers/nutanix/mutation/machinedetails/variables_test.go

+10
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ func TestVariableValidation(t *testing.T) {
4545
MemorySize: resource.MustParse("8Gi"),
4646
SystemDiskSize: resource.MustParse("40Gi"),
4747
Subnets: []v1alpha1.NutanixResourceIdentifier{},
48+
AdditionalCategories: []v1alpha1.NutanixCategoryIdentifier{
49+
{
50+
Key: "fake-key",
51+
Value: "fake-value1",
52+
},
53+
{
54+
Key: "fake-key",
55+
Value: "fake-value2",
56+
},
57+
},
4858
},
4959
},
5060
},

0 commit comments

Comments
 (0)