diff --git a/infrastructures/infrastructure-factory/pom.xml b/infrastructures/infrastructure-factory/pom.xml
index 57a94af672..ac978e3239 100644
--- a/infrastructures/infrastructure-factory/pom.xml
+++ b/infrastructures/infrastructure-factory/pom.xml
@@ -33,7 +33,7 @@
io.fabric8
- kubernetes-client
+ kubernetes-client-api
io.fabric8
diff --git a/infrastructures/infrastructure-factory/src/test/java/org/eclipse/che/api/factory/server/scm/kubernetes/KubernetesGitCredentialManagerTest.java b/infrastructures/infrastructure-factory/src/test/java/org/eclipse/che/api/factory/server/scm/kubernetes/KubernetesGitCredentialManagerTest.java
index 07e93a2040..621bc5838a 100644
--- a/infrastructures/infrastructure-factory/src/test/java/org/eclipse/che/api/factory/server/scm/kubernetes/KubernetesGitCredentialManagerTest.java
+++ b/infrastructures/infrastructure-factory/src/test/java/org/eclipse/che/api/factory/server/scm/kubernetes/KubernetesGitCredentialManagerTest.java
@@ -64,7 +64,7 @@ public class KubernetesGitCredentialManagerTest {
@Mock NonNamespaceOperation> nonNamespaceOperation;
- @Mock private FilterWatchListDeletable filterWatchDeletable;
+ @Mock private FilterWatchListDeletable> filterWatchDeletable;
@Mock private SecretList secretList;
diff --git a/infrastructures/kubernetes/pom.xml b/infrastructures/kubernetes/pom.xml
index 95aa07d233..1d2a534702 100644
--- a/infrastructures/kubernetes/pom.xml
+++ b/infrastructures/kubernetes/pom.xml
@@ -63,7 +63,7 @@
io.fabric8
- kubernetes-client
+ kubernetes-client-api
io.fabric8
diff --git a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesClientFactory.java b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesClientFactory.java
index 6576bac6b3..dcb2f77566 100644
--- a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesClientFactory.java
+++ b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesClientFactory.java
@@ -11,7 +11,6 @@
*/
package org.eclipse.che.workspace.infrastructure.kubernetes;
-import io.fabric8.kubernetes.client.BaseKubernetesClient;
import io.fabric8.kubernetes.client.Config;
import io.fabric8.kubernetes.client.DefaultKubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClient;
@@ -19,7 +18,6 @@ import io.fabric8.kubernetes.client.http.HttpClient;
import io.fabric8.kubernetes.client.utils.HttpClientUtils;
import javax.inject.Inject;
import javax.inject.Singleton;
-import okhttp3.OkHttpClient;
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
import org.eclipse.che.commons.annotation.Nullable;
@@ -94,12 +92,12 @@ public class KubernetesClientFactory {
}
/**
- * Creates instance of {@link KubernetesClient} that uses an {@link OkHttpClient} instance derived
+ * Creates instance of {@link KubernetesClient} that uses an {@link HttpClient} instance derived
* from the shared {@code httpClient} instance in which interceptors are overridden to
* authenticate with the credentials (user/password or Oauth token) contained in the {@code
* config} parameter.
*/
- protected BaseKubernetesClient> create(Config config) {
+ protected KubernetesClient create(Config config) {
return new UnclosableKubernetesClient(httpClient, config);
}
diff --git a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeployments.java b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeployments.java
index 62fdee249a..4c76a5917e 100644
--- a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeployments.java
+++ b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeployments.java
@@ -37,6 +37,7 @@ import io.fabric8.kubernetes.api.model.Pod;
import io.fabric8.kubernetes.api.model.PodSpec;
import io.fabric8.kubernetes.api.model.PodStatus;
import io.fabric8.kubernetes.api.model.ServiceAccount;
+import io.fabric8.kubernetes.api.model.StatusDetails;
import io.fabric8.kubernetes.api.model.apps.Deployment;
import io.fabric8.kubernetes.api.model.apps.DeploymentBuilder;
import io.fabric8.kubernetes.client.KubernetesClientException;
@@ -71,7 +72,6 @@ import java.util.function.Predicate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
-import okhttp3.Response;
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
import org.eclipse.che.commons.annotation.Nullable;
import org.eclipse.che.workspace.infrastructure.kubernetes.KubernetesClientFactory;
@@ -301,7 +301,7 @@ public class KubernetesDeployments {
CompletableFuture future = new CompletableFuture<>();
try {
- PodResource podResource =
+ PodResource podResource =
clientFactory.create(workspaceId).pods().inNamespace(namespace).withName(podName);
Watch watch =
@@ -366,7 +366,7 @@ public class KubernetesDeployments {
final CompletableFuture podRunningFuture = new CompletableFuture<>();
try {
final String podName = getPodName(name);
- final PodResource podResource =
+ final PodResource podResource =
clientFactory.create(workspaceId).pods().inNamespace(namespace).withName(podName);
final Watch watch =
podResource.watch(
@@ -941,18 +941,18 @@ public class KubernetesDeployments {
// If we have a Pod, we have to watch to make sure it is deleted, otherwise, we watch the
// Deployment we are deleting.
if (!Strings.isNullOrEmpty(podName)) {
- PodResource podResource =
+ PodResource podResource =
clientFactory.create(workspaceId).pods().inNamespace(namespace).withName(podName);
watch = podResource.watch(new DeleteWatcher<>(deleteFuture));
toCloseOnException = watch;
} else {
- watch = deploymentResource.watch(new DeleteWatcher(deleteFuture));
+ watch = deploymentResource.watch(new DeleteWatcher<>(deleteFuture));
toCloseOnException = watch;
}
- Boolean deleteSucceeded = deploymentResource.withPropagationPolicy(BACKGROUND).delete();
+ List deleted = deploymentResource.withPropagationPolicy(BACKGROUND).delete();
- if (deleteSucceeded == null || !deleteSucceeded) {
+ if (deleted == null || deleted.isEmpty()) {
deleteFuture.complete(null);
}
return deleteFuture.whenComplete(
@@ -978,7 +978,7 @@ public class KubernetesDeployments {
protected CompletableFuture doDeletePod(String podName) throws InfrastructureException {
Watch toCloseOnException = null;
try {
- PodResource podResource =
+ PodResource podResource =
clientFactory.create(workspaceId).pods().inNamespace(namespace).withName(podName);
if (podResource.get() == null) {
throw new InfrastructureException(format("No pod found to delete for name %s", podName));
@@ -988,8 +988,8 @@ public class KubernetesDeployments {
final Watch watch = podResource.watch(new DeleteWatcher<>(deleteFuture));
toCloseOnException = watch;
- Boolean deleteSucceeded = podResource.withPropagationPolicy(BACKGROUND).delete();
- if (deleteSucceeded == null || !deleteSucceeded) {
+ List deleted = podResource.withPropagationPolicy(BACKGROUND).delete();
+ if (deleted == null || deleted.isEmpty()) {
deleteFuture.complete(null);
}
return deleteFuture.whenComplete(
diff --git a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesObjectUtil.java b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesObjectUtil.java
index 2ff0495192..c2c029e9a1 100644
--- a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesObjectUtil.java
+++ b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesObjectUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2021 Red Hat, Inc.
+ * Copyright (c) 2012-2023 Red Hat, Inc.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
@@ -22,7 +22,7 @@ import io.fabric8.kubernetes.api.model.LabelSelector;
import io.fabric8.kubernetes.api.model.ObjectMeta;
import io.fabric8.kubernetes.api.model.PersistentVolumeClaim;
import io.fabric8.kubernetes.api.model.PersistentVolumeClaimBuilder;
-import io.fabric8.kubernetes.api.model.PersistentVolumeClaimFluent.SpecNested;
+import io.fabric8.kubernetes.api.model.PersistentVolumeClaimFluent;
import io.fabric8.kubernetes.api.model.PersistentVolumeClaimVolumeSource;
import io.fabric8.kubernetes.api.model.PersistentVolumeClaimVolumeSourceBuilder;
import io.fabric8.kubernetes.api.model.Quantity;
@@ -199,13 +199,15 @@ public class KubernetesObjectUtil {
*/
public static PersistentVolumeClaim newPVC(
String name, String accessMode, String quantity, String storageClassName) {
- SpecNested specs =
- new PersistentVolumeClaimBuilder()
- .withNewMetadata()
- .withName(name)
- .endMetadata()
- .withNewSpec()
- .withAccessModes(accessMode);
+ PersistentVolumeClaimFluent.SpecNested<
+ PersistentVolumeClaimBuilder>
+ specs =
+ new PersistentVolumeClaimBuilder()
+ .withNewMetadata()
+ .withName(name)
+ .endMetadata()
+ .withNewSpec()
+ .withAccessModes(accessMode);
if (!isNullOrEmpty(storageClassName)) {
specs.withStorageClassName(storageClassName);
}
diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesInternalRuntimeTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesInternalRuntimeTest.java
index 5e52ad89cb..e0c833f7ec 100644
--- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesInternalRuntimeTest.java
+++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesInternalRuntimeTest.java
@@ -843,7 +843,7 @@ public class KubernetesInternalRuntimeTest {
}
private static IntOrString intOrString(int port) {
- return new IntOrStringBuilder().withIntVal(port).withStrVal(String.valueOf(port)).build();
+ return new IntOrStringBuilder().withValue(port).withValue(String.valueOf(port)).build();
}
private static class MapBasedRuntimeStateCache implements KubernetesRuntimeStateCache {
diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/CheNamespaceTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/CheNamespaceTest.java
index 84f3d4a180..b66b5dc902 100644
--- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/CheNamespaceTest.java
+++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/CheNamespaceTest.java
@@ -25,8 +25,8 @@ import com.google.common.collect.ImmutableMap;
import io.fabric8.kubernetes.api.model.ConfigMap;
import io.fabric8.kubernetes.api.model.ConfigMapBuilder;
import io.fabric8.kubernetes.api.model.ConfigMapList;
+import io.fabric8.kubernetes.client.GracePeriodConfigurable;
import io.fabric8.kubernetes.client.KubernetesClient;
-import io.fabric8.kubernetes.client.dsl.EditReplacePatchDeletable;
import io.fabric8.kubernetes.client.dsl.MixedOperation;
import io.fabric8.kubernetes.client.dsl.Resource;
import java.util.Arrays;
@@ -70,7 +70,7 @@ public class CheNamespaceTest {
@Mock
private MixedOperation> kubeConfigMapsWithLabel;
- @Mock private EditReplacePatchDeletable kubeConfigMapsWithPropagationPolicy;
+ @Mock private GracePeriodConfigurable gracePeriodConfigurable;
@Mock private InternalRuntime internalRuntime;
@@ -237,12 +237,12 @@ public class CheNamespaceTest {
when(kubeConfigMapsInNamespace.withLabel(CHE_WORKSPACE_ID_LABEL, WORKSPACE_ID))
.thenReturn(kubeConfigMapsWithLabel);
when(kubeConfigMapsWithLabel.withPropagationPolicy(BACKGROUND))
- .thenReturn(kubeConfigMapsWithPropagationPolicy);
+ .thenReturn(gracePeriodConfigurable);
// when
cheNamespace.cleanUp(WORKSPACE_ID);
// then
- verify(kubeConfigMapsWithPropagationPolicy).delete();
+ verify(gracePeriodConfigurable).delete();
}
}
diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeploymentsTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeploymentsTest.java
index c053ee3f6e..759bf7f689 100644
--- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeploymentsTest.java
+++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeploymentsTest.java
@@ -13,6 +13,7 @@ package org.eclipse.che.workspace.infrastructure.kubernetes.namespace;
import static io.fabric8.kubernetes.api.model.DeletionPropagation.BACKGROUND;
import static java.util.Arrays.asList;
+import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
import static org.eclipse.che.workspace.infrastructure.kubernetes.Constants.POD_STATUS_PHASE_FAILED;
import static org.eclipse.che.workspace.infrastructure.kubernetes.Constants.POD_STATUS_PHASE_RUNNING;
@@ -55,12 +56,12 @@ import io.fabric8.kubernetes.api.model.apps.DeploymentBuilder;
import io.fabric8.kubernetes.api.model.apps.DeploymentList;
import io.fabric8.kubernetes.api.model.apps.DeploymentSpec;
import io.fabric8.kubernetes.api.model.apps.DeploymentSpecBuilder;
+import io.fabric8.kubernetes.client.GracePeriodConfigurable;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClientException;
import io.fabric8.kubernetes.client.Watch;
import io.fabric8.kubernetes.client.Watcher;
import io.fabric8.kubernetes.client.dsl.AppsAPIGroupDSL;
-import io.fabric8.kubernetes.client.dsl.EditReplacePatchDeletable;
import io.fabric8.kubernetes.client.dsl.FilterWatchListDeletable;
import io.fabric8.kubernetes.client.dsl.MixedOperation;
import io.fabric8.kubernetes.client.dsl.NonNamespaceOperation;
@@ -119,12 +120,12 @@ public class KubernetesDeploymentsTest {
@Mock private Deployment deployment;
@Mock private ObjectMeta deploymentMetadata;
@Mock private DeploymentSpec deploymentSpec;
- @Mock private EditReplacePatchDeletable deploymentEditReplacePatchDeletable;
+ @Mock private GracePeriodConfigurable gracePeriodConfigurable;
// Pod Mocks
@Mock private Pod pod;
@Mock private PodStatus status;
- @Mock private PodResource podResource;
+ @Mock private PodResource podResource;
@Mock private ObjectMeta metadata;
@Mock private MixedOperation podsMixedOperation;
@Mock private NonNamespaceOperation podsNamespaceOperation;
@@ -491,7 +492,7 @@ public class KubernetesDeploymentsTest {
public void testDeleteNonExistingPodBeforeWatch() throws Exception {
final String POD_NAME = "nonExistingPod";
- doReturn(Boolean.FALSE).when(podResource).delete();
+ doReturn(emptyList()).when(podResource).delete();
doReturn(podResource).when(podResource).withPropagationPolicy(eq(BACKGROUND));
Watch watch = mock(Watch.class);
doReturn(watch).when(podResource).watch(any());
@@ -527,7 +528,7 @@ public class KubernetesDeploymentsTest {
public void testDeleteNonExistingDeploymentBeforeWatch() throws Exception {
final String DEPLOYMENT_NAME = "nonExistingPod";
doReturn(deploymentResource).when(deploymentResource).withPropagationPolicy(eq(BACKGROUND));
- doReturn(Boolean.FALSE).when(deploymentResource).delete();
+ doReturn(emptyList()).when(deploymentResource).delete();
Watch watch = mock(Watch.class);
doReturn(watch).when(podResource).watch(any());
@@ -587,9 +588,9 @@ public class KubernetesDeploymentsTest {
public void testDeleteDeploymentThrowingAnyExceptionShouldCloseWatch() throws Exception {
final String DEPLOYMENT_NAME = "nonExistingPod";
when(deploymentResource.withPropagationPolicy(eq(BACKGROUND)))
- .thenReturn(deploymentEditReplacePatchDeletable);
+ .thenReturn(gracePeriodConfigurable);
doThrow(new RuntimeException("testDeleteDeploymentThrowingAnyExceptionShouldCloseWatch msg"))
- .when(deploymentEditReplacePatchDeletable)
+ .when(gracePeriodConfigurable)
.delete();
Watch watch = mock(Watch.class);
doReturn(watch).when(podResource).watch(any());
diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesNamespaceFactoryTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesNamespaceFactoryTest.java
index b24e010725..061c06aaf9 100644
--- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesNamespaceFactoryTest.java
+++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesNamespaceFactoryTest.java
@@ -135,7 +135,9 @@ public class KubernetesNamespaceFactoryTest {
private KubernetesNamespaceFactory namespaceFactory;
- @Mock private FilterWatchListDeletable namespaceListResource;
+ @Mock
+ private FilterWatchListDeletable>
+ namespaceListResource;
@Mock private NamespaceList namespaceList;
@@ -277,7 +279,7 @@ public class KubernetesNamespaceFactoryTest {
.withAnnotations(Map.of(NAMESPACE_ANNOTATION_NAME, "jondoe"))
.endMetadata()
.withNewStatus()
- .withNewPhase("Active")
+ .withPhase("Active")
.endStatus()
.build(),
new NamespaceBuilder()
@@ -286,7 +288,7 @@ public class KubernetesNamespaceFactoryTest {
.withAnnotations(Map.of(NAMESPACE_ANNOTATION_NAME, "jondoe"))
.endMetadata()
.withNewStatus()
- .withNewPhase("Active")
+ .withPhase("Active")
.endStatus()
.build(),
new NamespaceBuilder()
@@ -295,7 +297,7 @@ public class KubernetesNamespaceFactoryTest {
.withAnnotations(Map.of(NAMESPACE_ANNOTATION_NAME, "some_other_user"))
.endMetadata()
.withNewStatus()
- .withNewPhase("Active")
+ .withPhase("Active")
.endStatus()
.build());
doReturn(namespaces).when(namespaceList).getItems();
@@ -333,7 +335,7 @@ public class KubernetesNamespaceFactoryTest {
.withName("ns1")
.endMetadata()
.withNewStatus()
- .withNewPhase("Active")
+ .withPhase("Active")
.endStatus()
.build();
doThrow(new KubernetesClientException("Not allowed.", 403, new Status()))
@@ -397,7 +399,7 @@ public class KubernetesNamespaceFactoryTest {
.withName("jondoe-che")
.endMetadata()
.withNewStatus()
- .withNewPhase("Active")
+ .withPhase("Active")
.endStatus()
.build());
namespaceFactory =
@@ -1127,7 +1129,7 @@ public class KubernetesNamespaceFactoryTest {
.withAnnotations(Map.of(NAMESPACE_ANNOTATION_NAME, "jondoe"))
.endMetadata()
.withNewStatus()
- .withNewPhase("Active")
+ .withPhase("Active")
.endStatus()
.build(),
new NamespaceBuilder()
@@ -1136,7 +1138,7 @@ public class KubernetesNamespaceFactoryTest {
.withAnnotations(Map.of(NAMESPACE_ANNOTATION_NAME, "jondoe"))
.endMetadata()
.withNewStatus()
- .withNewPhase("Active")
+ .withPhase("Active")
.endStatus()
.build());
doReturn(namespaces).when(namespaceList).getItems();
@@ -1281,7 +1283,7 @@ public class KubernetesNamespaceFactoryTest {
.withAnnotations(Map.of(NAMESPACE_ANNOTATION_NAME, "jondoe"))
.endMetadata()
.withNewStatus()
- .withNewPhase("Active")
+ .withPhase("Active")
.endStatus()
.build());
doReturn(namespaces).when(namespaceList).getItems();
@@ -1458,7 +1460,7 @@ public class KubernetesNamespaceFactoryTest {
.withName(name)
.endMetadata()
.withNewStatus()
- .withNewPhase(phase)
+ .withPhase(phase)
.endStatus()
.build();
}
diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesSecretsTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesSecretsTest.java
index c525739bf0..40cfee0f3e 100644
--- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesSecretsTest.java
+++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesSecretsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2021 Red Hat, Inc.
+ * Copyright (c) 2012-2023 Red Hat, Inc.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
@@ -22,8 +22,8 @@ import static org.testng.Assert.assertEquals;
import io.fabric8.kubernetes.api.model.Secret;
import io.fabric8.kubernetes.api.model.SecretList;
+import io.fabric8.kubernetes.client.GracePeriodConfigurable;
import io.fabric8.kubernetes.client.KubernetesClient;
-import io.fabric8.kubernetes.client.dsl.EditReplacePatchDeletable;
import io.fabric8.kubernetes.client.dsl.FilterWatchListDeletable;
import io.fabric8.kubernetes.client.dsl.MixedOperation;
import io.fabric8.kubernetes.client.dsl.NonNamespaceOperation;
@@ -53,8 +53,8 @@ public class KubernetesSecretsTest {
@Mock private NonNamespaceOperation> nonNamespaceOperation;
- @Mock private FilterWatchListDeletable deletableList;
- @Mock private EditReplacePatchDeletable deletableSecret;
+ @Mock private FilterWatchListDeletable> deletableList;
+ @Mock private GracePeriodConfigurable deletableSecret;
private KubernetesSecrets kubernetesSecrets;
diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/log/ContainerLogWatchTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/log/ContainerLogWatchTest.java
index 6837c7c1f1..1f02dd4699 100644
--- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/log/ContainerLogWatchTest.java
+++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/log/ContainerLogWatchTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2021 Red Hat, Inc.
+ * Copyright (c) 2012-2023 Red Hat, Inc.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
@@ -24,13 +24,11 @@ import io.fabric8.kubernetes.api.model.Pod;
import io.fabric8.kubernetes.api.model.PodList;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.dsl.ContainerResource;
-import io.fabric8.kubernetes.client.dsl.ExecWatch;
import io.fabric8.kubernetes.client.dsl.LogWatch;
import io.fabric8.kubernetes.client.dsl.MixedOperation;
import io.fabric8.kubernetes.client.dsl.PodResource;
import java.io.IOException;
import java.io.InputStream;
-import java.io.OutputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.util.concurrent.CountDownLatch;
@@ -57,22 +55,10 @@ public class ContainerLogWatchTest {
@Mock PodLogHandler podLogHandler;
- @Mock MixedOperation> pods;
- @Mock PodResource podResource;
+ @Mock MixedOperation pods;
+ @Mock PodResource podResource;
- @Mock
- ContainerResource<
- LogWatch,
- InputStream,
- PipedOutputStream,
- OutputStream,
- PipedInputStream,
- String,
- ExecWatch,
- Boolean,
- InputStream,
- Boolean>
- containerResource;
+ @Mock ContainerResource containerResource;
LogWatchMock logWatch;
diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/server/IngressServerResolverTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/server/IngressServerResolverTest.java
index 14d25072ec..0a76a335fa 100644
--- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/server/IngressServerResolverTest.java
+++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/server/IngressServerResolverTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2021 Red Hat, Inc.
+ * Copyright (c) 2012-2023 Red Hat, Inc.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
@@ -17,7 +17,6 @@ import static java.util.Collections.singletonMap;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
-import io.fabric8.kubernetes.api.model.LoadBalancerStatusBuilder;
import io.fabric8.kubernetes.api.model.Service;
import io.fabric8.kubernetes.api.model.ServiceBuilder;
import io.fabric8.kubernetes.api.model.ServicePortBuilder;
@@ -26,6 +25,7 @@ import io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressRuleValue;
import io.fabric8.kubernetes.api.model.networking.v1.Ingress;
import io.fabric8.kubernetes.api.model.networking.v1.IngressBackend;
import io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder;
+import io.fabric8.kubernetes.api.model.networking.v1.IngressLoadBalancerStatusBuilder;
import io.fabric8.kubernetes.api.model.networking.v1.IngressRule;
import io.fabric8.kubernetes.api.model.networking.v1.IngressServiceBackend;
import io.fabric8.kubernetes.api.model.networking.v1.ServiceBackendPort;
@@ -276,7 +276,7 @@ public class IngressServerResolverTest {
new ServicePortBuilder()
.withPort(port)
.withNewTargetPort()
- .withIntVal(port)
+ .withValue(port)
.endTargetPort()
.build())
.endSpec()
@@ -310,7 +310,7 @@ public class IngressServerResolverTest {
.endSpec()
.withNewStatus()
.withLoadBalancer(
- new LoadBalancerStatusBuilder()
+ new IngressLoadBalancerStatusBuilder()
.addNewIngress()
.withIp("127.0.0.1")
.endIngress()
diff --git a/infrastructures/openshift/pom.xml b/infrastructures/openshift/pom.xml
index 03aa3a28ed..5620834144 100644
--- a/infrastructures/openshift/pom.xml
+++ b/infrastructures/openshift/pom.xml
@@ -36,7 +36,7 @@
io.fabric8
- kubernetes-client
+ kubernetes-client-api
io.fabric8
@@ -58,6 +58,10 @@
io.fabric8
openshift-client
+
+ io.fabric8
+ openshift-client-api
+
io.fabric8
openshift-model
diff --git a/infrastructures/openshift/src/main/java/org/eclipse/che/workspace/infrastructure/openshift/OpenShiftClientFactory.java b/infrastructures/openshift/src/main/java/org/eclipse/che/workspace/infrastructure/openshift/OpenShiftClientFactory.java
index 2fc569aa49..4b44dd81f1 100644
--- a/infrastructures/openshift/src/main/java/org/eclipse/che/workspace/infrastructure/openshift/OpenShiftClientFactory.java
+++ b/infrastructures/openshift/src/main/java/org/eclipse/che/workspace/infrastructure/openshift/OpenShiftClientFactory.java
@@ -15,7 +15,6 @@ import io.fabric8.kubernetes.client.Config;
import io.fabric8.kubernetes.client.DefaultKubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.http.HttpClient;
-import io.fabric8.kubernetes.client.utils.HttpClientUtils;
import io.fabric8.kubernetes.client.utils.TokenRefreshInterceptor;
import io.fabric8.openshift.client.DefaultOpenShiftClient;
import io.fabric8.openshift.client.OpenShiftClient;
@@ -85,8 +84,8 @@ public class OpenShiftClientFactory extends KubernetesClientFactory {
}
private HttpClient clientForConfig(OpenShiftConfig config) {
- HttpClient.Builder builder = httpClient.newBuilder().authenticatorNone();
- builder.addOrReplaceInterceptor(HttpClientUtils.HEADER_INTERCEPTOR, null);
+ HttpClient.DerivedClientBuilder builder = httpClient.newBuilder().authenticatorNone();
+ builder.addOrReplaceInterceptor("HEADER", null);
return builder
.addOrReplaceInterceptor(
TokenRefreshInterceptor.NAME, new OpenShiftOAuthInterceptor(httpClient, config))
diff --git a/infrastructures/openshift/src/main/java/org/eclipse/che/workspace/infrastructure/openshift/project/OpenShiftWorkspaceServiceAccount.java b/infrastructures/openshift/src/main/java/org/eclipse/che/workspace/infrastructure/openshift/project/OpenShiftWorkspaceServiceAccount.java
index 2933fc0af0..3e27c8ad16 100644
--- a/infrastructures/openshift/src/main/java/org/eclipse/che/workspace/infrastructure/openshift/project/OpenShiftWorkspaceServiceAccount.java
+++ b/infrastructures/openshift/src/main/java/org/eclipse/che/workspace/infrastructure/openshift/project/OpenShiftWorkspaceServiceAccount.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2021 Red Hat, Inc.
+ * Copyright (c) 2012-2023 Red Hat, Inc.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
@@ -77,7 +77,7 @@ public class OpenShiftWorkspaceServiceAccount
@Override
protected RoleBinding createRoleBinding(
String roleName, String bindingName, boolean clusterRole) {
- RoleBindingFluent.RoleRefNested bld =
+ RoleBindingFluent.RoleRefNested bld =
new RoleBindingBuilder()
.withNewMetadata()
.withName(bindingName)
diff --git a/infrastructures/openshift/src/test/java/org/eclipse/che/workspace/infrastructure/openshift/OpenShiftInternalRuntimeTest.java b/infrastructures/openshift/src/test/java/org/eclipse/che/workspace/infrastructure/openshift/OpenShiftInternalRuntimeTest.java
index fe720a7507..0873fe1465 100644
--- a/infrastructures/openshift/src/test/java/org/eclipse/che/workspace/infrastructure/openshift/OpenShiftInternalRuntimeTest.java
+++ b/infrastructures/openshift/src/test/java/org/eclipse/che/workspace/infrastructure/openshift/OpenShiftInternalRuntimeTest.java
@@ -312,6 +312,6 @@ public class OpenShiftInternalRuntimeTest {
}
private static IntOrString intOrString(int port) {
- return new IntOrStringBuilder().withIntVal(port).withStrVal(String.valueOf(port)).build();
+ return new IntOrStringBuilder().withValue(port).withValue(String.valueOf(port)).build();
}
}
diff --git a/infrastructures/openshift/src/test/java/org/eclipse/che/workspace/infrastructure/openshift/RouteServerResolverTest.java b/infrastructures/openshift/src/test/java/org/eclipse/che/workspace/infrastructure/openshift/RouteServerResolverTest.java
index bfb24891f4..bb0e2b4200 100644
--- a/infrastructures/openshift/src/test/java/org/eclipse/che/workspace/infrastructure/openshift/RouteServerResolverTest.java
+++ b/infrastructures/openshift/src/test/java/org/eclipse/che/workspace/infrastructure/openshift/RouteServerResolverTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2021 Red Hat, Inc.
+ * Copyright (c) 2012-2023 Red Hat, Inc.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
@@ -279,7 +279,7 @@ public class RouteServerResolverTest {
new ServicePortBuilder()
.withPort(port)
.withNewTargetPort()
- .withIntVal(port)
+ .withValue(port)
.endTargetPort()
.build())
.endSpec()
diff --git a/infrastructures/openshift/src/test/java/org/eclipse/che/workspace/infrastructure/openshift/project/OpenShiftProjectFactoryTest.java b/infrastructures/openshift/src/test/java/org/eclipse/che/workspace/infrastructure/openshift/project/OpenShiftProjectFactoryTest.java
index f04aebd85d..93f2d36876 100644
--- a/infrastructures/openshift/src/test/java/org/eclipse/che/workspace/infrastructure/openshift/project/OpenShiftProjectFactoryTest.java
+++ b/infrastructures/openshift/src/test/java/org/eclipse/che/workspace/infrastructure/openshift/project/OpenShiftProjectFactoryTest.java
@@ -122,7 +122,8 @@ public class OpenShiftProjectFactoryTest {
private OpenShiftProjectFactory projectFactory;
- @Mock private FilterWatchListDeletable projectListResource;
+ @Mock
+ private FilterWatchListDeletable> projectListResource;
@Mock private ProjectList projectList;
@@ -861,7 +862,7 @@ public class OpenShiftProjectFactoryTest {
.withAnnotations(annotations)
.endMetadata()
.withNewStatus()
- .withNewPhase(phase)
+ .withPhase(phase)
.endStatus()
.build();
}
diff --git a/pom.xml b/pom.xml
index bfc7217bba..93d2b0e19a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,7 +69,7 @@
false
quay.io/eclipse/che--centos--mysql-57-centos7:latest-e08ee4d43b7356607685b69bde6335e27cf20c020f345b6c6c59400183882764
quay.io/eclipse/che--centos--postgresql-13-centos7:1-71b24684d64da46f960682cc4216222a7e4ed8b1a31dd5a865b3e71afdea20d2
- 5.12.4
+ 6.8.1
0.2.2
1.8.1
1.8.1
@@ -1413,7 +1413,7 @@
io.fabric8
- kubernetes-client
+ kubernetes-client-api
${io.fabric8.kubernetes-client}
pom
import