mirror of https://github.com/k3s-io/k3s
Merge pull request #48263 from CaoShuFeng/useless_argument
Automatic merge from submit-queue remove useless argument "name" **Release note**: ``` NONE ```pull/6/head
commit
c3a39f763e
|
@ -28,7 +28,7 @@ func UserInfo(namespace, name, uid string) user.Info {
|
||||||
return &user.DefaultInfo{
|
return &user.DefaultInfo{
|
||||||
Name: apiserverserviceaccount.MakeUsername(namespace, name),
|
Name: apiserverserviceaccount.MakeUsername(namespace, name),
|
||||||
UID: uid,
|
UID: uid,
|
||||||
Groups: apiserverserviceaccount.MakeGroupNames(namespace, name),
|
Groups: apiserverserviceaccount.MakeGroupNames(namespace),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,8 @@ func SplitUsername(username string) (string, string, error) {
|
||||||
return namespace, name, nil
|
return namespace, name, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// MakeGroupNames generates service account group names for the given namespace and ServiceAccount name
|
// MakeGroupNames generates service account group names for the given namespace
|
||||||
func MakeGroupNames(namespace, name string) []string {
|
func MakeGroupNames(namespace string) []string {
|
||||||
return []string{
|
return []string{
|
||||||
AllServiceAccountsGroup,
|
AllServiceAccountsGroup,
|
||||||
MakeNamespaceGroupName(namespace),
|
MakeNamespaceGroupName(namespace),
|
||||||
|
|
|
@ -85,7 +85,7 @@ func WithImpersonation(handler http.Handler, requestContextMapper request.Reques
|
||||||
username = serviceaccount.MakeUsername(impersonationRequest.Namespace, impersonationRequest.Name)
|
username = serviceaccount.MakeUsername(impersonationRequest.Namespace, impersonationRequest.Name)
|
||||||
if !groupsSpecified {
|
if !groupsSpecified {
|
||||||
// if groups aren't specified for a service account, we know the groups because its a fixed mapping. Add them
|
// if groups aren't specified for a service account, we know the groups because its a fixed mapping. Add them
|
||||||
groups = serviceaccount.MakeGroupNames(impersonationRequest.Namespace, impersonationRequest.Name)
|
groups = serviceaccount.MakeGroupNames(impersonationRequest.Namespace)
|
||||||
}
|
}
|
||||||
|
|
||||||
case v1.SchemeGroupVersion.WithKind("User").GroupKind():
|
case v1.SchemeGroupVersion.WithKind("User").GroupKind():
|
||||||
|
|
Loading…
Reference in New Issue