From 6b7bf736e3d0241393aec9e862c3bb5750f3ff46 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Fri, 5 Mar 2021 19:45:57 +0100 Subject: [PATCH] Revert "fix: KubernetesDeployer now always deletes existing resources" This reverts commit 588db63138715a4e1e2a112676ab9ece2fab36ca. --- .../quarkus/kubernetes/deployment/KubernetesDeployer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesDeployer.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesDeployer.java index 00515e0b5373c..59f0bc43ac169 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesDeployer.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesDeployer.java @@ -1,6 +1,7 @@ package io.quarkus.kubernetes.deployment; +import static io.quarkus.kubernetes.deployment.Constants.KNATIVE; import static io.quarkus.kubernetes.deployment.Constants.KUBERNETES; import static io.quarkus.kubernetes.deployment.Constants.MINIKUBE; import static io.quarkus.kubernetes.deployment.Constants.OPENSHIFT; @@ -174,7 +175,11 @@ private DeploymentResultBuildItem deploy(DeploymentTargetEntry deploymentTarget, try (FileInputStream fis = new FileInputStream(manifest)) { KubernetesList list = Serialization.unmarshalAsList(fis); distinct(list.getItems()).forEach(i -> { - client.resource(i).inNamespace(namespace).deletingExisting().createOrReplace(); + if (KNATIVE.equals(deploymentTarget.getName().toLowerCase())) { + client.resource(i).inNamespace(namespace).deletingExisting().createOrReplace(); + } else { + client.resource(i).inNamespace(namespace).createOrReplace(); + } log.info("Applied: " + i.getKind() + " " + i.getMetadata().getName() + "."); });