diff --git a/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java b/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java index 13584271e1bb5..7354e21cab4e2 100644 --- a/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java +++ b/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java @@ -421,6 +421,12 @@ public static void createContainerImage(KubernetesClientBuilder kubernetesClient applyOpenshiftResources(openShiftClient, buildResources); openshiftBuild(buildResources, tar, openshiftConfig, kubernetesClientBuilder); + } finally { + try { + tar.delete(); + } catch (Exception e) { + LOG.warn("Unable to delete temporary file " + tar.toPath().toAbsolutePath(), e); + } } }