From df009cb2d4e6cc443229bc2794ebc9a407c50fb3 Mon Sep 17 00:00:00 2001 From: NoSkillGirl Date: Mon, 4 Jan 2021 12:33:00 +0530 Subject: [PATCH] remove resource details from log for log level higher than 3 --- pkg/generate/generate.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/generate/generate.go b/pkg/generate/generate.go index ac2acb8b3d..1fb720afa1 100644 --- a/pkg/generate/generate.go +++ b/pkg/generate/generate.go @@ -350,11 +350,11 @@ func applyRule(log logr.Logger, client *dclient.Client, rule kyverno.Rule, resou } if err != nil { - logger.Error(err, "failed to generate resource", "data", rdata, "mode", mode) + logger.Error(err, "failed to generate resource", "mode", mode) return newGenResource, err } - logger.V(2).Info("applying generate rule", "data", rdata, "mode", mode) + logger.V(2).Info("applying generate rule", "mode", mode) if rdata == nil && mode == Update { logger.V(4).Info("no changes required for target resource") @@ -431,9 +431,9 @@ func manageData(log logr.Logger, apiVersion, kind, namespace, name string, data return nil, Skip, err } - log.Info("found target resource", "resource", obj) + log.V(3).Info("found target resource", "resource", obj) if data == nil { - log.Info("data is nil - skipping update", "resource", obj) + log.V(3).Info("data is nil - skipping update", "resource", obj) return nil, Skip, nil }