Skip to content

Commit

Permalink
PR Review
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Silverio <[email protected]>
  • Loading branch information
jsilverio22 committed Mar 3, 2023
1 parent a62c402 commit f9c24cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ func (c *serviceAccountCache) Get(name, namespace string) (role, aud string, use
}
}
{
resp := c.getCM(name, namespace)
if resp != nil {
return resp.RoleARN, resp.Audience, resp.UseRegionalSTS, resp.TokenExpiration, nil
respCM := c.getCM(name, namespace)
if respCM != nil {
return respCM.RoleARN, respCM.Audience, respCM.UseRegionalSTS, respCM.TokenExpiration, nil
}
}
//if no mutation is needed due to annotations return nil err to allow request through
if respSA != nil && respSA.RoleARN == "" {
return "", "", false, pkg.DefaultTokenExpiration, nil
}
return "", "", false, pkg.DefaultTokenExpiration, fmt.Errorf("service account %s/%s not found in cache and one is expected", namespace, name)

}

func (c *serviceAccountCache) getSA(name, namespace string) *CacheResponse {
Expand Down

0 comments on commit f9c24cd

Please sign in to comment.