Skip to content

Commit

Permalink
fix: deprecate install webhook (#1616)
Browse files Browse the repository at this point in the history
  • Loading branch information
csviri committed Nov 23, 2022
1 parent 77be8f5 commit 5552723
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public Operator(KubernetesClient kubernetesClient, ConfigurationService configur
}

/** Adds a shutdown hook that automatically calls {@link #stop()} when the app shuts down. */
@Deprecated(forRemoval = true)
public void installShutdownHook() {
Runtime.getRuntime().addShutdownHook(new Thread(this::stop));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ Operator startOperator(boolean stopOnInformerErrorDuringStartup, boolean addStop
}
});
operator.register(reconciler);
operator.installShutdownHook();
operator.start();
return operator;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public static void main(String[] args) {
new Operator(client, c -> c.withLeaderElectionConfiguration(leaderElectionConfiguration));

operator.register(new LeaderElectionTestReconciler(identity));
operator.installShutdownHook();
operator.start();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public static void main(String[] args) throws IOException {
configOverrider -> configOverrider.replacingNamedDependentResourceConfig(
SchemaDependentResource.NAME,
new ResourcePollerConfig(300, MySQLDbConfig.loadFromEnvironmentVars())));
operator.installShutdownHook();
operator.start();

new FtBasic(new TkFork(new FkRegex("/health", "ALL GOOD!")), 8080).start(Exit.NEVER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public static void main(String[] args) throws IOException {
Operator operator = new Operator(client);
operator.register(new TomcatReconciler());
operator.register(new WebappReconciler(client));
operator.installShutdownHook();
operator.start();

new FtBasic(new TkFork(new FkRegex("/health", "ALL GOOD.")), 8080).start(Exit.NEVER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public static void main(String[] args) throws IOException {
} else {
operator.register(new WebPageStandaloneDependentsReconciler(client));
}
operator.installShutdownHook();
operator.start();

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

0 comments on commit 5552723

Please sign in to comment.