Fix account deletion blocked by deleted project admin mappings#12607
Open
SURYAS1306 wants to merge 1 commit intoapache:mainfrom
Open
Fix account deletion blocked by deleted project admin mappings#12607SURYAS1306 wants to merge 1 commit intoapache:mainfrom
SURYAS1306 wants to merge 1 commit intoapache:mainfrom
Conversation
2cb8b40 to
836f84a
Compare
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.
Description
When attempting to delete an account, CloudStack currently blocks the deletion if the
account is listed as an administrator of any project, even when those projects have
already been deleted (i.e.
removedis not null).This leads to a misleading error and prevents valid account deletion for accounts that
only manage already-deleted projects.
This PR improves the account deletion flow by ensuring that only active projects
are considered when checking whether an account manages projects. Deleted projects are
ignored, allowing the account deletion to proceed correctly.
A unit test has been added to validate this behavior and prevent regressions.
Fixes #12601
Expected behavior
An account should be deletable if it only manages projects that have already been deleted.
Actual behavior
Account deletion fails with an error indicating that the account manages projects,
even when all associated projects are already deleted.
Types of changes
Bug Severity
How Has This Been Tested?
AccountManagerImplTestto verify that an account managingonly deleted projects does not cause account deletion to fail.
account manages active projects.
How did you try to break this feature and the system with this change?
and correctly blocked otherwise.