use GlobalContext instead of context.Background when possible (#10254)

This commit is contained in:
Harshavardhana
2020-08-13 09:16:01 -07:00
committed by GitHub
parent ab43804efd
commit e7ba78beee
7 changed files with 20 additions and 14 deletions

View File

@@ -1640,7 +1640,7 @@ func (sys *IAMSys) IsAllowedServiceAccount(args iampolicy.Args, parent string) b
subPolicy, err := iampolicy.ParseConfig(bytes.NewReader([]byte(spolicyStr)))
if err != nil {
// Log any error in input session policy config.
logger.LogIf(context.Background(), err)
logger.LogIf(GlobalContext, err)
return false
}
@@ -1783,7 +1783,7 @@ func (sys *IAMSys) IsAllowedSTS(args iampolicy.Args) bool {
subPolicy, err := iampolicy.ParseConfig(bytes.NewReader([]byte(spolicyStr)))
if err != nil {
// Log any error in input session policy config.
logger.LogIf(context.Background(), err)
logger.LogIf(GlobalContext, err)
return false
}
@@ -1807,7 +1807,7 @@ func (sys *IAMSys) IsAllowed(args iampolicy.Args) bool {
if globalPolicyOPA != nil {
ok, err := globalPolicyOPA.IsAllowed(args)
if err != nil {
logger.LogIf(context.Background(), err)
logger.LogIf(GlobalContext, err)
}
return ok
}