Skip to content

Commit

Permalink
fix: fixing panic in debug log (#3244) cherry-pick (#3245)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaydipGabani authored Jan 31, 2024
1 parent 9d6cbc1 commit 5d4d7dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/audit/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,12 @@ func (am *Manager) auditFromCache(ctx context.Context) ([]Result, []error) {

excluded, err := am.skipExcludedNamespace(&obj)
if err != nil {
am.log.Error(err, "Unable to exclude object namespace for audit from cache %v %s/%s", obj.GroupVersionKind().String(), obj.GetNamespace(), obj.GetName())
am.log.Error(err, fmt.Sprintf("Unable to exclude object namespace for audit from cache %v %s/%s", obj.GroupVersionKind().String(), obj.GetNamespace(), obj.GetName()))
continue
}

if excluded {
am.log.V(logging.DebugLevel).Info("excluding object from audit from cache %v %s/%s", obj.GroupVersionKind().String(), obj.GetNamespace(), obj.GetName())
am.log.V(logging.DebugLevel).Info(fmt.Sprintf("excluding object from audit from cache %v %s/%s", obj.GroupVersionKind().String(), obj.GetNamespace(), obj.GetName()))
continue
}

Expand All @@ -525,7 +525,7 @@ func (am *Manager) auditFromCache(ctx context.Context) ([]Result, []error) {
}
resp, err := am.opa.Review(ctx, au, drivers.Stats(*logStatsAudit))
if err != nil {
am.log.Error(err, "Unable to review object from audit cache %v %s/%s", obj.GroupVersionKind().String(), obj.GetNamespace(), obj.GetName())
am.log.Error(err, fmt.Sprintf("Unable to review object from audit cache %v %s/%s", obj.GroupVersionKind().String(), obj.GetNamespace(), obj.GetName()))
continue
}

Expand Down

0 comments on commit 5d4d7dc

Please sign in to comment.