Skip to content

Commit bb0aba3

Browse files
lburgazzolimetacosm
authored andcommitted
feat: don't install a shutdown hook by default
Fixes #434
1 parent fe7d823 commit bb0aba3

File tree

1 file changed

+3
-0
lines changed
  • operator-framework-core/src/main/java/io/javaoperatorsdk/operator

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ public Operator(KubernetesClient k8sClient, ConfigurationService configurationSe
3333
this.lock = new Object();
3434
this.controllers = new ArrayList<>();
3535
this.started = false;
36+
}
3637

38+
/** Adds a shutdown hook that automatically calls {@link #close()} when the app shuts down. */
39+
public void installShutdownHook() {
3740
Runtime.getRuntime().addShutdownHook(new Thread(this::close));
3841
}
3942

0 commit comments

Comments
 (0)