Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove metrics flag since we're not using it #337

Merged
merged 1 commit into from
Sep 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions subcommand/controller/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ type Command struct {
k8s *flags.K8SFlags
httpFlags *flags.HTTPFlags

flagMetricsAddr string
flagWebhookTLSCertDir string
flagEnableLeaderElection bool

Expand Down Expand Up @@ -53,7 +52,6 @@ func init() {

func (c *Command) init() {
c.flagSet = flag.NewFlagSet("", flag.ContinueOnError)
c.flagSet.StringVar(&c.flagMetricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.")
c.flagSet.BoolVar(&c.flagEnableLeaderElection, "enable-leader-election", false,
"Enable leader election for controller. "+
"Enabling this will ensure there is only one active controller manager.")
Expand Down Expand Up @@ -94,11 +92,10 @@ func (c *Command) Run(args []string) int {
}

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: c.flagMetricsAddr,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If set to 0 metrics are disabled

Port: 9443,
LeaderElection: c.flagEnableLeaderElection,
LeaderElectionID: "consul.hashicorp.com",
Scheme: scheme,
Port: 9443,
LeaderElection: c.flagEnableLeaderElection,
LeaderElectionID: "consul.hashicorp.com",
})
if err != nil {
setupLog.Error(err, "unable to start manager")
Expand Down