Skip to content
Prev Previous commit
Next Next commit
expand "Addr" to "Address"
  • Loading branch information
cjerad committed Apr 6, 2022
commit d21781647b4f35a0997670a5fd9eeacb5cc66d47
12 changes: 6 additions & 6 deletions src/cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ var scheme = runtime.NewScheme()

type Options struct {
AWSRegion string
MetricsAddr string
MetricsAddress string
EnableLeaderElection bool
ProbeAddr string
ProbeAddress string
}

func init() {
Expand Down Expand Up @@ -109,9 +109,9 @@ func main() {

mgr, err := ctrl.NewManager(config, ctrl.Options{
Scheme: scheme,
MetricsBindAddress: options.MetricsAddr,
MetricsBindAddress: options.MetricsAddress,
Port: 9443,
HealthProbeBindAddress: options.ProbeAddr,
HealthProbeBindAddress: options.ProbeAddress,
LeaderElection: options.EnableLeaderElection,
LeaderElectionID: "aws-node-termination-handler.k8s.aws",
Logger: zapr.NewLogger(logging.FromContext(ctx).Desugar()),
Expand Down Expand Up @@ -197,8 +197,8 @@ func parseOptions() Options {
options := Options{}

flag.StringVar(&options.AWSRegion, "aws-region", os.Getenv("AWS_REGION"), "The AWS region for API calls.")
flag.StringVar(&options.MetricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
flag.StringVar(&options.ProbeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
flag.StringVar(&options.MetricsAddress, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
flag.StringVar(&options.ProbeAddress, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
flag.BoolVar(&options.EnableLeaderElection, "leader-elect", false, "Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
flag.Parse()
Expand Down