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() + "."); });