Skip to content

Commit

Permalink
Update Makefile and add PROJECT file to consul-k8s for operator-sdk a…
Browse files Browse the repository at this point in the history
…utogen
  • Loading branch information
Ashwin Venkatesh committed Aug 24, 2020
1 parent 1018548 commit 9cf07cf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ else
DEV_PUSH_ARG=--no-push
endif

all: bin
all: bin ctrl-generate

bin:
@$(SHELL) $(CURDIR)/build-support/scripts/build-local.sh
Expand Down
6 changes: 6 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
domain: hashicorp.com
layout: go.kubebuilder.io/v2
repo: github.com/hashicorp/consul-k8s
version: 3-alpha
plugins:
go.operator-sdk.io/v2-alpha: {}
3 changes: 2 additions & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ spec:
- name: CONSUL_HTTP_ADDR
value: http://$(HOST_IP):8500
command:
- /manager
- consul-k8s
- controller
args:
- --enable-leader-election
image: controller:latest
Expand Down
6 changes: 2 additions & 4 deletions subcommand/controller/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ func init() {
}

func (c *Command) init() {
var metricsAddr string
var enableLeaderElection bool
c.flags = flag.NewFlagSet("", flag.ContinueOnError)
c.flags.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.")
c.flags.BoolVar(&enableLeaderElection, "enable-leader-election", false,
c.flags.StringVar(&c.metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.")
c.flags.BoolVar(&c.enableLeaderElection, "enable-leader-election", false,
"Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
flags.Merge(c.flags, c.httpFlags.Flags())
Expand Down

0 comments on commit 9cf07cf

Please sign in to comment.