Skip to content

Fix subnet EnableDHCP to use *bool for correct omitempty behavior#244

Merged
pedrodeoliveira merged 1 commit intomasterfrom
fix-subnet-enable-dhcp-bool-pointer
Mar 19, 2026
Merged

Fix subnet EnableDHCP to use *bool for correct omitempty behavior#244
pedrodeoliveira merged 1 commit intomasterfrom
fix-subnet-enable-dhcp-bool-pointer

Conversation

@pedrodeoliveira
Copy link
Copy Markdown
Contributor

Summary

  • Change EnableDHCP from bool to *bool in CreateOpts and UpdateOpts so that omitempty can distinguish between "not set" (nil, omitted from JSON, API applies default) and "explicitly set to false".
  • Update the CLI client to only set the pointer when --enable-dhcp is explicitly provided.
  • Update test fixtures and expectations accordingly.

Test plan

  • go test ./gcore/subnet/v1/subnets/testing/... passes
  • go build ./gcore/subnet/... && go build ./client/subnets/... compiles

Change EnableDHCP from bool to *bool in CreateOpts and UpdateOpts
so that omitempty can distinguish between "not set" (nil, omitted
from JSON, API applies default) and "explicitly set to false".
@pedrodeoliveira pedrodeoliveira self-assigned this Mar 19, 2026
@pedrodeoliveira pedrodeoliveira merged commit 9b33a50 into master Mar 19, 2026
7 of 8 checks passed
@pedrodeoliveira pedrodeoliveira deleted the fix-subnet-enable-dhcp-bool-pointer branch March 19, 2026 12:06
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