mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
fixdup
This commit is contained in:
parent
614e3adda0
commit
d300706683
@ -231,18 +231,12 @@ func ValidateRoleBindingSubject(subject rbac.Subject, isNamespaced bool, fldPath
|
|||||||
|
|
||||||
case rbac.UserKind:
|
case rbac.UserKind:
|
||||||
// TODO(ericchiang): What other restrictions on user name are there?
|
// 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 {
|
if subject.APIGroup != rbac.GroupName {
|
||||||
allErrs = append(allErrs, field.NotSupported(fldPath.Child("apiGroup"), subject.APIGroup, []string{rbac.GroupName}))
|
allErrs = append(allErrs, field.NotSupported(fldPath.Child("apiGroup"), subject.APIGroup, []string{rbac.GroupName}))
|
||||||
}
|
}
|
||||||
|
|
||||||
case rbac.GroupKind:
|
case rbac.GroupKind:
|
||||||
// TODO(ericchiang): What other restrictions on group name are there?
|
// 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 {
|
if subject.APIGroup != rbac.GroupName {
|
||||||
allErrs = append(allErrs, field.NotSupported(fldPath.Child("apiGroup"), subject.APIGroup, []string{rbac.GroupName}))
|
allErrs = append(allErrs, field.NotSupported(fldPath.Child("apiGroup"), subject.APIGroup, []string{rbac.GroupName}))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user