1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-15 17:51:20 +00:00

feat: print container flags and their values (#7127)

* add condition msg to v2beta1

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* print flags settings

Signed-off-by: ShutingZhao <shuting@nirmata.com>

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
This commit is contained in:
shuting 2023-05-08 23:38:14 +08:00 committed by GitHub
parent ef55e716a6
commit 78a02a6102
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -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)
})
}

View file

@ -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)