Skip to content

role: include DomainID in adoption listing for domain-scoped roles#733

Merged
mandre merged 1 commit intok-orc:mainfrom
shiftstack:fix-role-adoption
Apr 2, 2026
Merged

role: include DomainID in adoption listing for domain-scoped roles#733
mandre merged 1 commit intok-orc:mainfrom
shiftstack:fix-role-adoption

Conversation

@mandre
Copy link
Copy Markdown
Collaborator

@mandre mandre commented Apr 1, 2026

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

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.
@github-actions github-actions bot added the semver:patch No API change label Apr 1, 2026
Copy link
Copy Markdown
Contributor

@dlaw4608 dlaw4608 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! passing all the validation, I Ran it locally as well and got no issues.

@mandre mandre added this pull request to the merge queue Apr 2, 2026
Merged via the queue into k-orc:main with commit 63736b2 Apr 2, 2026
10 checks passed
@mandre mandre deleted the fix-role-adoption branch April 2, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:patch No API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potential failure to create role with domain_id

2 participants