Skip to content

Commit 8952bd2

Browse files
committed
fixup! feat: Add additionalCategories field to Nutanix machine details patch
Add additionalCategories to variables test
1 parent d92bfa2 commit 8952bd2

File tree

5 files changed

+24
-41
lines changed

5 files changed

+24
-41
lines changed

api/v1alpha1/nutanix_node_types.go

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

6363
// Defines the boot type of the virtual machine. Only supports UEFI and Legacy
6464
BootType NutanixBootType `json:"bootType,omitempty"`
@@ -208,17 +208,3 @@ func (NutanixCategoryIdentifier) VariableSchema() clusterv1.VariableSchema {
208208
},
209209
}
210210
}
211-
212-
type NutanixCategoryIdentifiers []NutanixCategoryIdentifier
213-
214-
func (NutanixCategoryIdentifiers) VariableSchema() clusterv1.VariableSchema {
215-
resourceSchema := NutanixCategoryIdentifier{}.VariableSchema().OpenAPIV3Schema
216-
217-
return clusterv1.VariableSchema{
218-
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
219-
Description: "Nutanix category identifiers",
220-
Type: "array",
221-
Items: &resourceSchema,
222-
},
223-
}
224-
}

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
},

test/e2e/e2e_suite_test.go

+11-5
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,17 @@ func initBootstrapCluster(
258258
clusterctl.InitManagementClusterAndWatchControllerLogs(
259259
context.TODO(),
260260
clusterctl.InitManagementClusterAndWatchControllerLogsInput{
261-
ClusterProxy: bootstrapClusterProxy,
262-
ClusterctlConfigPath: clusterctlConfig,
263-
InfrastructureProviders: config.GetProviderLatestVersionsByContract("*", config.InfrastructureProviders()...),
264-
AddonProviders: config.GetProviderLatestVersionsByContract("*", config.AddonProviders()...),
265-
RuntimeExtensionProviders: config.GetProviderLatestVersionsByContract("*", config.RuntimeExtensionProviders()...),
261+
ClusterProxy: bootstrapClusterProxy,
262+
ClusterctlConfigPath: clusterctlConfig,
263+
InfrastructureProviders: config.GetProviderLatestVersionsByContract(
264+
"*",
265+
config.InfrastructureProviders()...),
266+
AddonProviders: config.GetProviderLatestVersionsByContract(
267+
"*",
268+
config.AddonProviders()...),
269+
RuntimeExtensionProviders: config.GetProviderLatestVersionsByContract(
270+
"*",
271+
config.RuntimeExtensionProviders()...),
266272
LogFolder: filepath.Join(
267273
artifactFolder,
268274
"clusters",

0 commit comments

Comments
 (0)