mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 21:25:09 +00:00
[pkg/controller/serviceaccount]: refactor to more idiomatic go
Signed-off-by: Zhou Peng <p@ctriple.cn>
This commit is contained in:
@@ -199,8 +199,7 @@ func (c *ServiceAccountsController) syncNamespace(key string) error {
|
||||
}
|
||||
|
||||
createFailures := []error{}
|
||||
for i := range c.serviceAccountsToEnsure {
|
||||
sa := c.serviceAccountsToEnsure[i]
|
||||
for _, sa := range c.serviceAccountsToEnsure {
|
||||
switch _, err := c.saLister.ServiceAccounts(ns.Name).Get(sa.Name); {
|
||||
case err == nil:
|
||||
continue
|
||||
|
Reference in New Issue
Block a user