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

Commit c480c50

Browse files
committed
added correct size of subnets slice
1 parent cdbe128 commit c480c50

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,7 @@ func (h *nutanixMachineDetailsControlPlanePatchHandler) Mutate(
128128
nutanixMachineDetailsVar.SystemDiskSize,
129129
)
130130

131-
obj.Spec.Template.Spec.Subnets = make(
132-
[]capxv1.NutanixResourceIdentifier,
133-
len(nutanixMachineDetailsVar.Subnets),
134-
)
131+
obj.Spec.Template.Spec.Subnets = make([]capxv1.NutanixResourceIdentifier, 0)
135132
for _, subnetCRE := range nutanixMachineDetailsVar.Subnets {
136133
if subnetCRE.Type == "" {
137134
continue

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ func (h *nutanixMachineDetailsWorkerPatchHandler) Mutate(
121121
obj.Spec.Template.Spec.SystemDiskSize = resource.MustParse(
122122
nutanixMachineDetailsVar.SystemDiskSize,
123123
)
124+
obj.Spec.Template.Spec.Subnets = make([]capxv1.NutanixResourceIdentifier, 0)
124125
for _, subnetCRE := range nutanixMachineDetailsVar.Subnets {
125126
if subnetCRE.Type == "" {
126127
continue

0 commit comments

Comments
 (0)