Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
  • Loading branch information
everettraven committed Jun 8, 2023
1 parent c040cc5 commit 353165a
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ func main() {
catalogdVersion bool
sysNs string
)
// set up a regular go flagset for our normal flags
flagSet := flag.NewFlagSet("catalogd-flagset", flag.ExitOnError)
flagSet := flag.NewFlagSet("catalogd", flag.ExitOnError)
flagSet.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
flagSet.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
flagSet.BoolVar(&enableLeaderElection, "leader-elect", false,
Expand All @@ -76,20 +75,14 @@ func main() {
flagSet.StringVar(&sysNs, "system-ns", "catalogd-system", "The namespace catalogd uses for internal state, configuration, and workloads")
flagSet.BoolVar(&profiling, "profiling", false, "enable profiling endpoints to allow for using pprof")
flagSet.BoolVar(&catalogdVersion, "version", false, "print the catalogd version and exit")

// set up zap options and add flags to the flagset
opts := zap.Options{
Development: true,
}
opts.BindFlags(flagSet)

// set up feature gate flags. This has to use a pflag flagset
pFlagSet := pflag.NewFlagSet("featuregate-flagset", pflag.ExitOnError)
features.CatalogdFeatureGate.AddFlag(pFlagSet)

// Combine both flagsets and parse them
pflag.CommandLine.AddGoFlagSet(flagSet)
pflag.CommandLine.AddFlagSet(pFlagSet)
features.CatalogdFeatureGate.AddFlag(pflag.CommandLine)
pflag.Parse()

if catalogdVersion {
Expand Down

0 comments on commit 353165a

Please sign in to comment.