Merge pull request #78159 from byteor/master

[pkg/controller/serviceaccount]: refactor to more idiomatic go
This commit is contained in:
Kubernetes Prow Robot 2019-05-22 15:14:37 -07:00 committed by GitHub
commit 0cea0675ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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