Skip to content

refactor: update NumCoresPerSocket to *int32#3906

Merged
tenthirtyam merged 2 commits intovmware:mainfrom
spacegospod:feat/num-cores-per-socket
Nov 25, 2025
Merged

refactor: update NumCoresPerSocket to *int32#3906
tenthirtyam merged 2 commits intovmware:mainfrom
spacegospod:feat/num-cores-per-socket

Conversation

@spacegospod
Copy link
Copy Markdown
Collaborator

Description

NumCoresPerSocket on types.VirtualMachineConfigSpec is an int32 and annotated with "omitempty"
This makes it impossible to pass 0 when calling ReconfigVM and CreateVM.

To remediate this I am changing the field to an *int32. Now its zero value will be nil and 0 will be serialized along with the rest of the structure.

Closes: N/A

How Has This Been Tested?

Configured a local override for vmware/govmomi in vmware/terraform-provider-vsphere and ran tests which create and reconfigure virtual machines.
I verified that nil, 0 and any positive integer (if valid for that VM) is accepted by vCenter

Guidelines

Please read and follow the CONTRIBUTION guidelines of this project.

Signed-off-by: Stoyan Zhelyazkov <stoyan.zhelyazkov@broadcom.com>
@spacegospod spacegospod force-pushed the feat/num-cores-per-socket branch from 1adecde to 7a189fa Compare November 20, 2025 13:59
Signed-off-by: Stoyan Zhelyazkov <stoyan.zhelyazkov@broadcom.com>
@tenthirtyam tenthirtyam requested review from akutz and dougm November 20, 2025 17:13
@tenthirtyam tenthirtyam merged commit 3496d48 into vmware:main Nov 25, 2025
11 checks passed
@tenthirtyam tenthirtyam changed the title feat: change NumCoresPerSocket to *int32 refactor: update NumCoresPerSocket to *int32 Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants