Skip to content

Commit 9a0d987

Browse files
committed
fix: add shutdown hook to close watchers on exit
1 parent 91a7153 commit 9a0d987

File tree

1 file changed

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

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public Operator(KubernetesClient k8sClient, ConfigurationService configurationSe
2828
this.k8sClient = k8sClient;
2929
this.configurationService = configurationService;
3030
this.closeables = new ArrayList<>();
31+
32+
Runtime.getRuntime().addShutdownHook(new Thread(this::close));
3133
}
3234

3335
/**

0 commit comments

Comments
 (0)