Skip to content

Allow clearing Placement resource provider parent_provider_uuid - #3749

Merged
mandre merged 1 commit into
gophercloud:mainfrom
Etua:fix-placement-resource-provider-parent-provider-uuid-update
May 21, 2026
Merged

mandre merged 1 commit into
gophercloud:mainfrom
Etua:fix-placement-resource-provider-parent-provider-uuid-update

Conversation

@Etua

@Etua Etua commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

Current implementation describes the possibility to set parent_provider_uuid for a child resource provider to detach it from its parent, but actually doesn't allow it due to the use of omitempty which would clear such nil input.
To allow for this operation, I introduce the empty value of "" replaced by nil before being sent. This pattern allows for parent_provider_uuid to remain an optional argument just as in the API. Such pattern was previously introduced in DNS recordsets.

Fixes #3746
Related #526

@github-actions github-actions Bot added edit:placement This PR updates placement code semver:patch No API change backport-v2 This PR will be backported to v2 labels May 13, 2026
@coveralls

coveralls commented May 13, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 64.013%. remained the same — Etua:fix-placement-resource-provider-parent-provider-uuid-update into gophercloud:main

Current implementation describes the possibility to set
parent_provider_uuid for a child resource provider to detach it from its
parent, but actually doesn't allow it due to the use of omitempty which
would clear such nil input.
To allow for this operation, I introduce the empty value of "" replaced
by nil before being sent. This pattern allows for parent_provider_uuid
to remain an optional argument just as in the API. Such pattern was
previously introduced in DNS recordsets.

Fixes gophercloud#3746

Signed-off-by: Dominik Danelski <[email protected]>
@Etua
Etua force-pushed the fix-placement-resource-provider-parent-provider-uuid-update branch from c9d3fa8 to e09b30f Compare May 13, 2026 17:42
@mandre
mandre added this pull request to the merge queue May 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 21, 2026
@Etua

Etua commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

@mandre Something broke at the merge stage.

@mandre

mandre commented May 21, 2026

Copy link
Copy Markdown
Contributor

@mandre Something broke at the merge stage.

Indeed, coverall was down. Let's give it another try.

@mandre
mandre added this pull request to the merge queue May 21, 2026
Merged via the queue into gophercloud:main with commit 315483e May 21, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v2 This PR will be backported to v2 edit:placement This PR updates placement code semver:patch No API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Placement: parent_provider_uuid cannot be set to null in UpdateOpts for resource provider

3 participants