Skip to content
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ private void stopLeading() {
// Note that some reconciliations might run for a very long time.
System.exit(1);
} else {
// just for testing purposes
log.info("Stopped leading, configured not to exit");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class LeaderElectionConfiguration {
private final Duration retryPeriod;

private final LeaderCallbacks leaderCallbacks;

/** Set to false only for testing purposes. */
private final boolean exitOnStopLeading;

public LeaderElectionConfiguration(String leaseName, String leaseNamespace, String identity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public LeaderElectionConfigurationBuilder withLeaderCallbacks(LeaderCallbacks le
return this;
}

/** Set to false only for testing purposes. */
public LeaderElectionConfigurationBuilder withExitOnStopLeading(boolean exitOnStopLeading) {
this.exitOnStopLeading = exitOnStopLeading;
return this;
Expand Down