Skip to content

Commit 5552723

Browse files
authored
fix: deprecate install webhook (#1616)
1 parent 77be8f5 commit 5552723

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
@@ -66,6 +66,7 @@ public Operator(KubernetesClient kubernetesClient, ConfigurationService configur
6666
}
6767

6868
/** Adds a shutdown hook that automatically calls {@link #stop()} when the app shuts down. */
69+
@Deprecated(forRemoval = true)
6970
public void installShutdownHook() {
7071
Runtime.getRuntime().addShutdownHook(new Thread(this::stop));
7172
}

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
@@ -33,7 +33,6 @@ public static void main(String[] args) throws IOException {
3333
} else {
3434
operator.register(new WebPageStandaloneDependentsReconciler(client));
3535
}
36-
operator.installShutdownHook();
3736
operator.start();
3837

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

0 commit comments

Comments
 (0)