mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +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:
parent
ef55e716a6
commit
78a02a6102
2 changed files with 9 additions and 0 deletions
|
@ -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)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue