diff --git a/cmd/internal/flag.go b/cmd/internal/flag.go index e05f0017d4..4c18463aa2 100644 --- a/cmd/internal/flag.go +++ b/cmd/internal/flag.go @@ -4,6 +4,7 @@ import ( "flag" "time" + "github.com/go-logr/logr" "github.com/kyverno/kyverno/pkg/leaderelection" "github.com/kyverno/kyverno/pkg/logging" ) @@ -194,3 +195,10 @@ func PolicyExceptionEnabled() bool { func LeaderElectionRetryPeriod() time.Duration { return leaderElectionRetryPeriod } + +func printFlagSettings(logger logr.Logger) { + logger = logger.WithName("flag") + flag.VisitAll(func(f *flag.Flag) { + logger.V(2).Info("", f.Name, f.Value) + }) +} diff --git a/cmd/internal/setup.go b/cmd/internal/setup.go index 26d33e13f9..7108d7a0a9 100644 --- a/cmd/internal/setup.go +++ b/cmd/internal/setup.go @@ -47,6 +47,7 @@ type SetupResult struct { func Setup(config Configuration, name string, skipResourceFilters bool) (context.Context, SetupResult, context.CancelFunc) { logger := setupLogger() showVersion(logger) + printFlagSettings(logger) sdownMaxProcs := setupMaxProcs(logger) setupProfiling(logger) ctx, sdownSignals := setupSignals(logger)