diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/Operator.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/Operator.java index 9bcd72673d..926c2239be 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/Operator.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/Operator.java @@ -27,7 +27,9 @@ public Operator(KubernetesClient k8sClient, ConfigurationService configurationSe this.k8sClient = k8sClient; this.configurationService = configurationService; this.closeables = new ArrayList<>(); + } + public void installShutdownHook() { Runtime.getRuntime().addShutdownHook(new Thread(this::close)); }