Skip to content

fix: send nil for admin_state_up when unspecified in ecl_network_port_v2 - #139

Open
kajiuray wants to merge 1 commit into
nttcom:masterfrom
kajiuray:fix/port-admin-state-up-default
Open

fix: send nil for admin_state_up when unspecified in ecl_network_port_v2#139
kajiuray wants to merge 1 commit into
nttcom:masterfrom
kajiuray:fix/port-admin-state-up-default

Conversation

@kajiuray

@kajiuray kajiuray commented May 4, 2026

Copy link
Copy Markdown
Contributor

resourcePortAdminStateUpV2 was always returning a non-nil *bool(false), causing "admin_state_up": false to be sent to the API even when the user omitted the field. This bypassed the server-side default of true, leaving ports in an administratively down state unexpectedly.

Fix by using GetOkExists so that nil is returned when the field is not set, allowing eclcloud's omitempty to suppress the field and let the server apply its default (true). This aligns with the pattern already used by ecl_network_network_v2.

resourcePortAdminStateUpV2 was always returning a non-nil *bool(false),
causing "admin_state_up": false to be sent to the API even when the user
omitted the field. This bypassed the server-side default of true,
leaving ports in an administratively down state unexpectedly.

Fix by using GetOkExists so that nil is returned when the field is not
set, allowing eclcloud's omitempty to suppress the field and let the
server apply its default (true). This aligns with the pattern already
used by ecl_network_network_v2.
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.

1 participant