Skip to content

Commit

Permalink
fix(quarkusio#10823): use delete existing when applying knative resou…
Browse files Browse the repository at this point in the history
…rces
  • Loading branch information
iocanel committed Jul 20, 2020
1 parent fb8e2a5 commit acf233e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package io.quarkus.kubernetes.deployment;

import static io.quarkus.container.image.deployment.util.ImageUtil.hasRegistry;
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;
Expand Down Expand Up @@ -168,7 +169,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).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() + ".");
});

Expand Down

0 comments on commit acf233e

Please sign in to comment.