Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/src/main/java/com/cloud/user/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface Account extends ControlledEntity, InternalIdentity, Identity {
* Account states.
* */
enum State {
DISABLED, ENABLED, LOCKED;
DISABLED, ENABLED, LOCKED, REMOVED;

/**
* The toString method was overridden to maintain consistency in the DB, as the GenericDaoBase uses toString in the enum value to make the sql statements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,6 @@ CREATE TABLE `cloud`.`vm_scheduled_job` (
-- Add support for different cluster types for kubernetes
ALTER TABLE `cloud`.`kubernetes_cluster` ADD COLUMN `cluster_type` varchar(64) DEFAULT 'CloudManaged' COMMENT 'type of cluster';
ALTER TABLE `cloud`.`kubernetes_cluster` MODIFY COLUMN `kubernetes_version_id` bigint unsigned NULL COMMENT 'the ID of the Kubernetes version of this Kubernetes cluster';

-- Set removed state for all removed accounts
UPDATE `cloud`.`account` SET state='removed' WHERE `removed` IS NOT NULL;
3 changes: 3 additions & 0 deletions server/src/main/java/com/cloud/user/AccountManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,9 @@ public boolean deleteAccount(AccountVO account, long callerUserId, Account calle
return false;
}

account.setState(State.REMOVED);
_accountDao.update(accountId, account);

if (s_logger.isDebugEnabled()) {
s_logger.debug("Removed account " + accountId);
}
Expand Down