Repository navigation
Implement Placement allocationcandidates - #3701
Merged
mandre merged 2 commits intoApr 10, 2026
Merged
Conversation
Related gophercloud#526 API reference: https://docs.openstack.org/api-ref/placement/#list-allocation-candidates Code reference: https://opendev.org/openstack/placement/src/branch/stable/2026.1/placement/handlers/allocation_candidate.py#L256-L304 Signed-off-by: Dominik Danelski <[email protected]>
mandre
reviewed
Apr 9, 2026
mandre
left a comment
Contributor
There was a problem hiding this comment.
Really nice work, the design choice make sense to me, so no objection to that. We should perhaps fix the IsEmpty() method that will crash with the 1.10 microversion.
Full deserialisation could crash on older structure defined for 1.10. Co-authored-by: Martin André <[email protected]> Signed-off-by: Dominik Danelski <[email protected]>
mandre
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related #526
API reference:
https://docs.openstack.org/api-ref/placement/#list-allocation-candidates
Code reference:
https://opendev.org/openstack/placement/src/branch/stable/2026.1/placement/handlers/allocation_candidate.py#L256-L304
I didn't create separate microversions for every change when an argument could be repeated starting from … (change from
stringto[]string), since one can create a single-element slice, so the request can still be expressed using this structure for any microversion 1.12+ unlike the array to map transition at 1.11 to 1.12. Having separate microversions for every such change would balloon the number of structures and related tests to 5+.I also made the newer request structure the default and put the one from the first 2 microversions (1.10-1.11) in microversions.go, as the old version was made in 2018 and there's a low chance one would default to the original shape, which is very limited in expressiveness of request and response.
Please let me know if any of these decisions would prevent this patch from being merged.