diff --git a/node/src/main/java/io/fabric8/jube/local/NodeHelper.java b/node/src/main/java/io/fabric8/jube/local/NodeHelper.java index aeaa653..efd8019 100644 --- a/node/src/main/java/io/fabric8/jube/local/NodeHelper.java +++ b/node/src/main/java/io/fabric8/jube/local/NodeHelper.java @@ -385,8 +385,22 @@ protected static void deleteContainer(ProcessManager processManager, KubernetesM return; } ProcessController controller = installation.getController(); - controller.kill(); - controller.uninstall(); + // try graceful to stop first, then kill afterwards + try { + controller.stop(); + } catch (Exception e) { + LOG.warn("Error during stopping container. Will now attempt to forcibly kill the container.", e); + } + try { + controller.kill(); + } catch (Exception e) { + LOG.warn("Error during killing container. Will now attempt to uninstall the container.", e); + } + try { + controller.uninstall(); + } catch (Exception e) { + + } model.deletePod(pod.getId()); }