diff --git a/cmd/initContainer/main.go b/cmd/initContainer/main.go index e36a5ecd6f..8def91b52d 100644 --- a/cmd/initContainer/main.go +++ b/cmd/initContainer/main.go @@ -59,7 +59,7 @@ const ( func main() { klog.InitFlags(nil) - log.SetLogger(klogr.New()) + log.SetLogger(klogr.New().WithCallDepth(1)) // arguments flag.StringVar(&kubeconfig, "kubeconfig", "", "Path to a kubeconfig. Only required if out-of-cluster.") flag.Float64Var(&clientRateLimitQPS, "clientRateLimitQPS", 0, "Configure the maximum QPS to the Kubernetes API server from Kyverno. Uses the client default if zero.") diff --git a/cmd/kyverno/main.go b/cmd/kyverno/main.go index 08523ca4ef..639277d3d4 100755 --- a/cmd/kyverno/main.go +++ b/cmd/kyverno/main.go @@ -72,7 +72,7 @@ var ( func main() { klog.InitFlags(nil) - log.SetLogger(klogr.New()) + log.SetLogger(klogr.New().WithCallDepth(1)) flag.StringVar(&filterK8sResources, "filterK8sResources", "", "Resource in format [kind,namespace,name] where policy is not evaluated by the admission webhook. For example, --filterK8sResources \"[Deployment, kyverno, kyverno],[Events, *, *]\"") flag.StringVar(&excludeGroupRole, "excludeGroupRole", "", "") flag.StringVar(&excludeUsername, "excludeUsername", "", "")