Skip to content

Commit

Permalink
remove duplicate results' entries from policy report
Browse files Browse the repository at this point in the history
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
  • Loading branch information
realshuting committed Feb 8, 2021
1 parent c148573 commit 50b126f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/policyreport/reportcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,13 @@ func (g *ReportGenerator) syncHandler(key string) error {
// return the existing report if exist
func (g *ReportGenerator) createReportIfNotPresent(namespace string, new *unstructured.Unstructured, aggregatedRequests interface{}) (report interface{}, err error) {
log := g.log.WithName("createReportIfNotPresent")
obj, err := updateResults(new.UnstructuredContent(), new.UnstructuredContent(), nil)
if err != nil {
g.log.Info("warning: post-scanning report's results failed", "policy report", new.GetName(), "err", err.Error())
} else {
new.Object = obj
}

if namespace != "" {
ns, err := g.nsLister.Get(namespace)
if err != nil {
Expand Down

0 comments on commit 50b126f

Please sign in to comment.