role: include DomainID in adoption listing for domain-scoped roles#733
Merged
mandre merged 1 commit intok-orc:mainfrom Apr 2, 2026
Merged
role: include DomainID in adoption listing for domain-scoped roles#733mandre merged 1 commit intok-orc:mainfrom
mandre merged 1 commit intok-orc:mainfrom
Conversation
Keystone's GET /v3/roles API implicitly filters to domain_id=NULL (global roles only) when no domain_id parameter is provided. This means domain-scoped roles are invisible to the adoption check in ListOSResourcesForAdoption, which only filtered by name. If a stale informer cache read causes the controller to re-enter the create path after a successful creation, the adoption mechanism fails to find the just-created domain-scoped role, resulting in a duplicate POST and a terminal 409 Conflict error. Fix by resolving the domain dependency and including DomainID in the roles.ListOpts when domainRef is set.
dlaw4608
approved these changes
Apr 2, 2026
Contributor
dlaw4608
left a comment
There was a problem hiding this comment.
LGTM! passing all the validation, I Ran it locally as well and got no issues.
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.
Keystone's GET /v3/roles API implicitly filters to domain_id=NULL (global roles only) when no domain_id parameter is provided. This means domain-scoped roles are invisible to the adoption check in ListOSResourcesForAdoption, which only filtered by name.
If a stale informer cache read causes the controller to re-enter the create path after a successful creation, the adoption mechanism fails to find the just-created domain-scoped role, resulting in a duplicate POST and a terminal 409 Conflict error.
Fix by resolving the domain dependency and including DomainID in the roles.ListOpts when domainRef is set.
Fixes #732