Skip to content

Commit b09bf5c

Browse files
metacosmcsviri
authored andcommitted
refactor: isLeaderElectionOn -> isLeaderElectionEnabled
1 parent 93a260a commit b09bf5c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/LeaderElectionManager.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void init(LeaderElectionConfiguration config, KubernetesClient client) {
4040
.build();
4141
}
4242

43-
public boolean isLeaderElectionOn() {
43+
public boolean isLeaderElectionEnabled() {
4444
return leaderElector != null;
4545
}
4646

@@ -57,12 +57,12 @@ private void stopLeading() {
5757
log.info("Stopped leading for identity: {}. Exiting.", identity);
5858
// When leader stops leading the process ends immediately to prevent multiple reconciliations
5959
// running parallel.
60-
// Note that some reconciliations might run a very long time.
60+
// Note that some reconciliations might run for a very long time.
6161
System.exit(1);
6262
}
6363

6464
public void start() {
65-
if (isLeaderElectionOn()) {
65+
if (isLeaderElectionEnabled()) {
6666
leaderElectionFuture = leaderElector.start();
6767
}
6868
}

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/Operator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public void start() {
9999
ExecutorServiceManager.init();
100100
// first start the controller manager before leader election,
101101
// the leader election would start subsequently the processor if on
102-
controllerManager.start(!leaderElectionManager.isLeaderElectionOn());
102+
controllerManager.start(!leaderElectionManager.isLeaderElectionEnabled());
103103
leaderElectionManager.start();
104104
} catch (Exception e) {
105105
log.error("Error starting operator", e);

0 commit comments

Comments
 (0)