Skip to content

Commit

Permalink
log manager options (#165)
Browse files Browse the repository at this point in the history
* log manager options

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>

* log used or non-empty default flags

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
  • Loading branch information
everettraven authored Jun 1, 2022
1 parent 31344eb commit 0cb815d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
15 changes: 15 additions & 0 deletions internal/cmd/helm-operator/run/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,21 @@ func run(cmd *cobra.Command, f *flags.Flags) {
// Set default manager options
options = f.ToManagerOptions(options)

// Log manager option flags
// Log manager option flags
optionsLog := map[string]interface{}{
"MetricsBindAddress": options.MetricsBindAddress,
"HealthProbeAddress": options.HealthProbeBindAddress,
"LeaderElection": options.LeaderElection,
}
if options.LeaderElectionID != "" {
optionsLog["LeaderElectionId"] = options.LeaderElectionID
}
if options.LeaderElectionNamespace != "" {
optionsLog["LeaderElectionNamespace"] = options.LeaderElectionNamespace
}
log.Info("Setting manager options", "Options", optionsLog)

if options.NewClient == nil {
options.NewClient = helmmgr.NewCachingClientFunc()
}
Expand Down
14 changes: 14 additions & 0 deletions internal/cmd/hybrid-operator/run/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,20 @@ func run(cmd *cobra.Command, f *flags.Flags) {
// Set default manager options
options = f.ToManagerOptions(options)

// Log manager option flags
optionsLog := map[string]interface{}{
"MetricsBindAddress": options.MetricsBindAddress,
"HealthProbeAddress": options.HealthProbeBindAddress,
"LeaderElection": options.LeaderElection,
}
if options.LeaderElectionID != "" {
optionsLog["LeaderElectionId"] = options.LeaderElectionID
}
if options.LeaderElectionNamespace != "" {
optionsLog["LeaderElectionNamespace"] = options.LeaderElectionNamespace
}
log.Info("Setting manager options", "Options", optionsLog)

if options.NewClient == nil {
options.NewClient = helmmgr.NewCachingClientFunc()
}
Expand Down

0 comments on commit 0cb815d

Please sign in to comment.