Skip to content

Commit 8eaa9a2

Browse files
committed
docs: add javadoc on leader election exit
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
1 parent 5f085c9 commit 8eaa9a2

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ private void stopLeading() {
126126
// Note that some reconciliations might run for a very long time.
127127
System.exit(1);
128128
} else {
129+
// just for testing purposes
129130
log.info("Stopped leading, configured not to exit");
130131
}
131132
}

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/LeaderElectionConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public class LeaderElectionConfiguration {
3535
private final Duration retryPeriod;
3636

3737
private final LeaderCallbacks leaderCallbacks;
38+
39+
/** Set to false only for testing purposes. */
3840
private final boolean exitOnStopLeading;
3941

4042
public LeaderElectionConfiguration(String leaseName, String leaseNamespace, String identity) {

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/LeaderElectionConfigurationBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public LeaderElectionConfigurationBuilder withLeaderCallbacks(LeaderCallbacks le
7171
return this;
7272
}
7373

74+
/** Set to false only for testing purposes. */
7475
public LeaderElectionConfigurationBuilder withExitOnStopLeading(boolean exitOnStopLeading) {
7576
this.exitOnStopLeading = exitOnStopLeading;
7677
return this;

0 commit comments

Comments
 (0)