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

Fix fatal error when k8s registrar leader election enabled #1814

Merged
merged 1 commit into from
Sep 1, 2020

Conversation

JonathanO
Copy link
Contributor

The LeaderElectionID used to have a default in older versions of controller-runtime, but now needs setting explicitly. Without it set the registrar will fatal error when reconcile/crd modes have leader election enabled. Populate it with a sensible value, based on the configured controller name for reconcile mode, or a fixed value for crd mode.

Also enable leader election in the integration test for reconcile, since it's a flag that's unlikely to get adhoc testing otherwise.

This used to default in older versions of controller-runtime, but the behaviour changed and now it must be specified.
Enable leader election in the integration test for reconcile, since it's a flag that's unlikely to get adhoc testing.

Signed-off-by: Jonathan Oddy <jonathan.oddy@transferwise.com>
@JonathanO
Copy link
Contributor Author

@faisal-memon I've added the parameter for crd mode too. It has no impact if leader election is disabled. It just sets the name of the ConfigMap to use for leader election. The behaviour was changed in controller-runtime because the default used to be "controller", which led to collisions between different controllers if people hadn't altered it to make it unique to their controller.

Copy link
Member

@azdagron azdagron left a comment

Choose a reason for hiding this comment

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

Thanks, @JonathanO !

@azdagron azdagron merged commit 7f16ea9 into spiffe:master Sep 1, 2020
@JonathanO JonathanO deleted the fix-registrar-leader-election branch September 1, 2020 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants