mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Merge pull request #48317 from CaoShuFeng/impersonation_group
Automatic merge from submit-queue remove useless check from impersonation filter When groupsSpecified is false, that means no other groups are added rather than the service account groups. So this check doesn't make any sense. **Release note**: ``` NONE ```
This commit is contained in:
commit
fbba67098b
@ -118,18 +118,8 @@ func WithImpersonation(handler http.Handler, requestContextMapper request.Reques
|
||||
|
||||
if !groupsSpecified && username != user.Anonymous {
|
||||
// When impersonating a non-anonymous user, if no groups were specified
|
||||
// if neither the system:authenticated nor system:unauthenticated groups are explicitly included,
|
||||
// include the system:authenticated group in the impersonated user info
|
||||
found := false
|
||||
for _, group := range groups {
|
||||
if group == user.AllAuthenticated || group == user.AllUnauthenticated {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
groups = append(groups, user.AllAuthenticated)
|
||||
}
|
||||
groups = append(groups, user.AllAuthenticated)
|
||||
}
|
||||
|
||||
newUser := &user.DefaultInfo{
|
||||
|
Loading…
Reference in New Issue
Block a user