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.
问题复现:
Step 1. 创建一个角色,并绑定到一个已有帐号
Step 2. 创建一个跟上一步跟角色名称是前缀包含的新角色后
Step 3. 删除新角色会报错
根因:检查角色是否绑定帐号的etcd实现中,前缀匹配查询没有增加“/”结尾,导致前缀相同的其他角色的帐号都误认为是当前角色绑定的
修复方案:前缀匹配增加“/”
Follow this checklist to help us incorporate your contribution quickly and easily:
[SCB-XXX] Fixes bug in ApproximateQuantiles
, where you replaceSCB-XXX
with the appropriate JIRA issue.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.