mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #66203 from tanshanshan/fixdup
Automatic merge from submit-queue (batch tested with PRs 66203, 66224). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. remove reduplicative validate **What this PR does / why we need it**: remove reduplicative validate there's already a global checkc861ceb41a/pkg/apis/rbac/validation/validation.go (L214-L216)
so the code below makes these checks redundantc861ceb41a/pkg/apis/rbac/validation/validation.go (L234-L236)
c861ceb41a/pkg/apis/rbac/validation/validation.go (L243-L245)
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
commit
7a431c3125
@ -231,18 +231,12 @@ func ValidateRoleBindingSubject(subject rbac.Subject, isNamespaced bool, fldPath
|
||||
|
||||
case rbac.UserKind:
|
||||
// TODO(ericchiang): What other restrictions on user name are there?
|
||||
if len(subject.Name) == 0 {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), subject.Name, "user name cannot be empty"))
|
||||
}
|
||||
if subject.APIGroup != rbac.GroupName {
|
||||
allErrs = append(allErrs, field.NotSupported(fldPath.Child("apiGroup"), subject.APIGroup, []string{rbac.GroupName}))
|
||||
}
|
||||
|
||||
case rbac.GroupKind:
|
||||
// TODO(ericchiang): What other restrictions on group name are there?
|
||||
if len(subject.Name) == 0 {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), subject.Name, "group name cannot be empty"))
|
||||
}
|
||||
if subject.APIGroup != rbac.GroupName {
|
||||
allErrs = append(allErrs, field.NotSupported(fldPath.Child("apiGroup"), subject.APIGroup, []string{rbac.GroupName}))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user