From 97c09232ae43010c983184b970dfbaab0a95cf8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8E=E1=85=AC=E1=84=89=E1=85=AE=E1=84=8B=E1=85=AF?= =?UTF-8?q?=E1=86=AB?= Date: Sat, 13 Jan 2024 18:03:16 +0900 Subject: [PATCH] refactor: KubernetesSshServiceForwarder uses deprecated method --- .../jkube/kit/remotedev/KubernetesSshServiceForwarder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jkube-kit/remote-dev/src/main/java/org/eclipse/jkube/kit/remotedev/KubernetesSshServiceForwarder.java b/jkube-kit/remote-dev/src/main/java/org/eclipse/jkube/kit/remotedev/KubernetesSshServiceForwarder.java index 448142bc9f..96b0d242be 100644 --- a/jkube-kit/remote-dev/src/main/java/org/eclipse/jkube/kit/remotedev/KubernetesSshServiceForwarder.java +++ b/jkube-kit/remote-dev/src/main/java/org/eclipse/jkube/kit/remotedev/KubernetesSshServiceForwarder.java @@ -18,6 +18,7 @@ import io.fabric8.kubernetes.api.model.PodBuilder; import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.kubernetes.client.LocalPortForward; +import io.fabric8.kubernetes.client.dsl.NonDeletingOperation; import org.eclipse.jkube.kit.common.KitLogger; import java.io.IOException; @@ -110,7 +111,7 @@ private Pod deploySshServerPod() { .addNewPort().withContainerPort(localService.getPort()).withProtocol("TCP").endPort() .endContainer().endSpec(); } - return kubernetesClient.pods().resource(pod.build()).createOrReplace(); + return kubernetesClient.pods().resource(pod.build()).createOr(NonDeletingOperation::update); // Using createOrReplace instead of SSA because MockServer doesn't support this PATCH // unless the resource already exists // .patch(PatchContext.of(PatchType.SERVER_SIDE_APPLY), pod.build());