Skip to content

Commit e182cd9

Browse files
committed
fix: deprecate install webhook (#1616)
1 parent 1ec4d7c commit e182cd9

File tree

6 files changed

+1
-5
lines changed

6 files changed

+1
-5
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public Operator(KubernetesClient kubernetesClient, ConfigurationService configur
7272
}
7373

7474
/** Adds a shutdown hook that automatically calls {@link #stop()} when the app shuts down. */
75+
@Deprecated(forRemoval = true)
7576
public void installShutdownHook() {
7677
if (!leaderElectionManager.isLeaderElectionEnabled()) {
7778
Runtime.getRuntime().addShutdownHook(new Thread(this::stop));

operator-framework/src/test/java/io/javaoperatorsdk/operator/InformerRelatedBehaviorITS.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ Operator startOperator(boolean stopOnInformerErrorDuringStartup, boolean addStop
211211
}
212212
});
213213
operator.register(reconciler);
214-
operator.installShutdownHook();
215214
operator.start();
216215
return operator;
217216
}

sample-operators/leader-election/src/main/java/io/javaoperatorsdk/operator/sample/LeaderElectionTestOperator.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public static void main(String[] args) {
2727
new Operator(client, c -> c.withLeaderElectionConfiguration(leaderElectionConfiguration));
2828

2929
operator.register(new LeaderElectionTestReconciler(identity));
30-
operator.installShutdownHook();
3130
operator.start();
3231
}
3332
}

sample-operators/mysql-schema/src/main/java/io/javaoperatorsdk/operator/sample/MySQLSchemaOperator.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public static void main(String[] args) throws IOException {
3434
configOverrider -> configOverrider.replacingNamedDependentResourceConfig(
3535
SchemaDependentResource.NAME,
3636
new ResourcePollerConfig(300, MySQLDbConfig.loadFromEnvironmentVars())));
37-
operator.installShutdownHook();
3837
operator.start();
3938

4039
new FtBasic(new TkFork(new FkRegex("/health", "ALL GOOD!")), 8080).start(Exit.NEVER);

sample-operators/tomcat-operator/src/main/java/io/javaoperatorsdk/operator/sample/TomcatOperator.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public static void main(String[] args) throws IOException {
2222
Operator operator = new Operator(client);
2323
operator.register(new TomcatReconciler());
2424
operator.register(new WebappReconciler(client));
25-
operator.installShutdownHook();
2625
operator.start();
2726

2827
new FtBasic(new TkFork(new FkRegex("/health", "ALL GOOD.")), 8080).start(Exit.NEVER);

sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageOperator.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public static void main(String[] args) throws IOException {
3434
} else {
3535
operator.register(new WebPageStandaloneDependentsReconciler(client));
3636
}
37-
operator.installShutdownHook();
3837
operator.start();
3938

4039
new FtBasic(new TkFork(new FkRegex("/health", "ALL GOOD!")), 8080).start(Exit.NEVER);

0 commit comments

Comments
 (0)