mirror of https://github.com/k3s-io/k3s
remove useless argument "name"
parent
b353792f9c
commit
2e97611bc6
|
@ -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),
|
||||||
|
|
|
@ -84,7 +84,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