Skip to content

Commit b82e81f

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

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

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

+3
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)