From b07ae5e25fb67f6593de95d84fc0e994bdc439dd Mon Sep 17 00:00:00 2001 From: Chin2691 Date: Wed, 13 May 2026 10:21:13 +0530 Subject: [PATCH] OCPBUGS-85509: Add omitempty to vSphere and Nutanix MachinePool slice fields Add omitempty to optional slice fields (DataDisks, GPUs) in vSphere and Nutanix MachinePool types. Without omitempty, marshaling a zero-valued struct emits dataDisks: null / gpus: null, which older installer payloads treat as unknown fields and emit warnings during cluster provisioning via automation tools (Hive, assisted-service). Azure's DataDisks already carries omitempty; this brings vSphere and Nutanix into alignment. Assisted-by: Codex 5.3 Co-authored-by: Cursor --- pkg/types/nutanix/machinepool.go | 4 ++-- pkg/types/vsphere/machinepool.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/types/nutanix/machinepool.go b/pkg/types/nutanix/machinepool.go index 8bf667fc69e..c6c5479f7c1 100644 --- a/pkg/types/nutanix/machinepool.go +++ b/pkg/types/nutanix/machinepool.go @@ -61,12 +61,12 @@ type MachinePool struct { // GPUs is a list of GPU devices to attach to the machine's VM. // +listType=set // +optional - GPUs []machinev1.NutanixGPU `json:"gpus"` + GPUs []machinev1.NutanixGPU `json:"gpus,omitempty"` // DataDisks holds information of the data disks to attach to the Machine's VM // +listType=set // +optional - DataDisks []DataDisk `json:"dataDisks"` + DataDisks []DataDisk `json:"dataDisks,omitempty"` // FailureDomains optionally configures a list of failure domain names // that will be applied to the MachinePool diff --git a/pkg/types/vsphere/machinepool.go b/pkg/types/vsphere/machinepool.go index 1a0fdb06e32..ff65a0161f5 100644 --- a/pkg/types/vsphere/machinepool.go +++ b/pkg/types/vsphere/machinepool.go @@ -30,7 +30,7 @@ type MachinePool struct { // +listType=map // +listMapKey=name // +kubebuilder:validation:MaxItems=29 - DataDisks []DataDisk `json:"dataDisks"` + DataDisks []DataDisk `json:"dataDisks,omitempty"` // Zones defines available zones // Zones is available in TechPreview.