Skip to content

[Bug] [API]Update tenant failed in API #7396

@roylion

Description

@roylion

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

    /**
     * if the tenant code is modified, the original resource needs to be copied to the new tenant.
     */
    if (!tenant.getTenantCode().equals(tenantCode)) {
        if (checkTenantExists(tenantCode)) { **********************此处判断条件有误**********************
            // if hdfs startup
            省略。。。
        } else {
            putMsg(result, Status.OS_TENANT_CODE_HAS_ALREADY_EXISTS);
            return result;
        }
    }

What you expected to happen

    /**
     * if the tenant code is modified, the original resource needs to be copied to the new tenant.
     */
    if (!tenant.getTenantCode().equals(tenantCode)) {
        if (!checkTenantExists(tenantCode)) { **********************此处判断条件改为不存在时复制资源**********************
            // if hdfs startup
            省略。。。
        } else {
            putMsg(result, Status.OS_TENANT_CODE_HAS_ALREADY_EXISTS);
            return result;
        }
    }

How to reproduce

修改一个已存在的租户名称,且新的租户名称没有与其他租户名称重复,提交时会提示 “操作系统租户已存在”

版本号:2.0.1-release

Anything else

No response

Version

dev

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions