Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Can not delete unused role #1152

Merged
merged 1 commit into from
Sep 13, 2021
Merged

Conversation

little-cui
Copy link
Member

@little-cui little-cui commented Sep 13, 2021

问题复现:
Step 1. 创建一个角色,并绑定到一个已有帐号
Step 2. 创建一个跟上一步跟角色名称是前缀包含的新角色后
Step 3. 删除新角色会报错

根因:检查角色是否绑定帐号的etcd实现中,前缀匹配查询没有增加“/”结尾,导致前缀相同的其他角色的帐号都误认为是当前角色绑定的

修复方案:前缀匹配增加“/”

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [SCB-XXX] Fixes bug in ApproximateQuantiles, where you replace SCB-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run go build go test go fmt go vet to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.
  • Never comment source code, delete it.
  • UT should has "context, subject, expected result" result as test case name, when you call t.Run().

@tianxiaoliang
Copy link
Contributor

记录根因和修复方式

@tianxiaoliang tianxiaoliang merged commit abed953 into apache:master Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants