Update io.fabric8.kubernetes-client version to latest (#549)
parent
7d0cfb306c
commit
ce6ed7e9c0
|
|
@ -33,7 +33,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>kubernetes-client</artifactId>
|
||||
<artifactId>kubernetes-client-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.fabric8</groupId>
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public class KubernetesGitCredentialManagerTest {
|
|||
|
||||
@Mock NonNamespaceOperation<Secret, SecretList, Resource<Secret>> nonNamespaceOperation;
|
||||
|
||||
@Mock private FilterWatchListDeletable<Secret, SecretList> filterWatchDeletable;
|
||||
@Mock private FilterWatchListDeletable<Secret, SecretList, Resource<Secret>> filterWatchDeletable;
|
||||
|
||||
@Mock private SecretList secretList;
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>kubernetes-client</artifactId>
|
||||
<artifactId>kubernetes-client-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.fabric8</groupId>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Pod> future = new CompletableFuture<>();
|
||||
try {
|
||||
|
||||
PodResource<Pod> podResource =
|
||||
PodResource podResource =
|
||||
clientFactory.create(workspaceId).pods().inNamespace(namespace).withName(podName);
|
||||
|
||||
Watch watch =
|
||||
|
|
@ -366,7 +366,7 @@ public class KubernetesDeployments {
|
|||
final CompletableFuture<Void> podRunningFuture = new CompletableFuture<>();
|
||||
try {
|
||||
final String podName = getPodName(name);
|
||||
final PodResource<Pod> 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<Pod> 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<Deployment>(deleteFuture));
|
||||
watch = deploymentResource.watch(new DeleteWatcher<>(deleteFuture));
|
||||
toCloseOnException = watch;
|
||||
}
|
||||
|
||||
Boolean deleteSucceeded = deploymentResource.withPropagationPolicy(BACKGROUND).delete();
|
||||
List<StatusDetails> 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<Void> doDeletePod(String podName) throws InfrastructureException {
|
||||
Watch toCloseOnException = null;
|
||||
try {
|
||||
PodResource<Pod> 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<StatusDetails> deleted = podResource.withPropagationPolicy(BACKGROUND).delete();
|
||||
if (deleted == null || deleted.isEmpty()) {
|
||||
deleteFuture.complete(null);
|
||||
}
|
||||
return deleteFuture.whenComplete(
|
||||
|
|
|
|||
|
|
@ -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<PersistentVolumeClaimBuilder> specs =
|
||||
new PersistentVolumeClaimBuilder()
|
||||
.withNewMetadata()
|
||||
.withName(name)
|
||||
.endMetadata()
|
||||
.withNewSpec()
|
||||
.withAccessModes(accessMode);
|
||||
PersistentVolumeClaimFluent<PersistentVolumeClaimBuilder>.SpecNested<
|
||||
PersistentVolumeClaimBuilder>
|
||||
specs =
|
||||
new PersistentVolumeClaimBuilder()
|
||||
.withNewMetadata()
|
||||
.withName(name)
|
||||
.endMetadata()
|
||||
.withNewSpec()
|
||||
.withAccessModes(accessMode);
|
||||
if (!isNullOrEmpty(storageClassName)) {
|
||||
specs.withStorageClassName(storageClassName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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<ConfigMap, ConfigMapList, Resource<ConfigMap>> kubeConfigMapsWithLabel;
|
||||
|
||||
@Mock private EditReplacePatchDeletable<ConfigMap> 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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Deployment> deploymentEditReplacePatchDeletable;
|
||||
@Mock private GracePeriodConfigurable gracePeriodConfigurable;
|
||||
|
||||
// Pod Mocks
|
||||
@Mock private Pod pod;
|
||||
@Mock private PodStatus status;
|
||||
@Mock private PodResource<Pod> 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());
|
||||
|
|
|
|||
|
|
@ -135,7 +135,9 @@ public class KubernetesNamespaceFactoryTest {
|
|||
|
||||
private KubernetesNamespaceFactory namespaceFactory;
|
||||
|
||||
@Mock private FilterWatchListDeletable<Namespace, NamespaceList> namespaceListResource;
|
||||
@Mock
|
||||
private FilterWatchListDeletable<Namespace, NamespaceList, Resource<NamespaceList>>
|
||||
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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Secret, SecretList, Resource<Secret>> nonNamespaceOperation;
|
||||
|
||||
@Mock private FilterWatchListDeletable<Secret, SecretList> deletableList;
|
||||
@Mock private EditReplacePatchDeletable<Secret> deletableSecret;
|
||||
@Mock private FilterWatchListDeletable<Secret, SecretList, Resource<Secret>> deletableList;
|
||||
@Mock private GracePeriodConfigurable<Secret> deletableSecret;
|
||||
|
||||
private KubernetesSecrets kubernetesSecrets;
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Pod, PodList, PodResource<Pod>> pods;
|
||||
@Mock PodResource<Pod> podResource;
|
||||
@Mock MixedOperation<Pod, PodList, PodResource> pods;
|
||||
@Mock PodResource podResource;
|
||||
|
||||
@Mock
|
||||
ContainerResource<
|
||||
LogWatch,
|
||||
InputStream,
|
||||
PipedOutputStream,
|
||||
OutputStream,
|
||||
PipedInputStream,
|
||||
String,
|
||||
ExecWatch,
|
||||
Boolean,
|
||||
InputStream,
|
||||
Boolean>
|
||||
containerResource;
|
||||
@Mock ContainerResource containerResource;
|
||||
|
||||
LogWatchMock logWatch;
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>kubernetes-client</artifactId>
|
||||
<artifactId>kubernetes-client-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.fabric8</groupId>
|
||||
|
|
@ -58,6 +58,10 @@
|
|||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>openshift-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>openshift-client-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>openshift-model</artifactId>
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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<RoleBindingBuilder> bld =
|
||||
RoleBindingFluent<RoleBindingBuilder>.RoleRefNested<RoleBindingBuilder> bld =
|
||||
new RoleBindingBuilder()
|
||||
.withNewMetadata()
|
||||
.withName(bindingName)
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -122,7 +122,8 @@ public class OpenShiftProjectFactoryTest {
|
|||
|
||||
private OpenShiftProjectFactory projectFactory;
|
||||
|
||||
@Mock private FilterWatchListDeletable<Project, ProjectList> projectListResource;
|
||||
@Mock
|
||||
private FilterWatchListDeletable<Project, ProjectList, Resource<Project>> projectListResource;
|
||||
|
||||
@Mock private ProjectList projectList;
|
||||
|
||||
|
|
@ -861,7 +862,7 @@ public class OpenShiftProjectFactoryTest {
|
|||
.withAnnotations(annotations)
|
||||
.endMetadata()
|
||||
.withNewStatus()
|
||||
.withNewPhase(phase)
|
||||
.withPhase(phase)
|
||||
.endStatus()
|
||||
.build();
|
||||
}
|
||||
|
|
|
|||
4
pom.xml
4
pom.xml
|
|
@ -69,7 +69,7 @@
|
|||
<enforcer.skip>false</enforcer.skip>
|
||||
<integration.mysql.db.image>quay.io/eclipse/che--centos--mysql-57-centos7:latest-e08ee4d43b7356607685b69bde6335e27cf20c020f345b6c6c59400183882764</integration.mysql.db.image>
|
||||
<integration.postgresql.db.image>quay.io/eclipse/che--centos--postgresql-13-centos7:1-71b24684d64da46f960682cc4216222a7e4ed8b1a31dd5a865b3e71afdea20d2</integration.postgresql.db.image>
|
||||
<io.fabric8.kubernetes-client>5.12.4</io.fabric8.kubernetes-client>
|
||||
<io.fabric8.kubernetes-client>6.8.1</io.fabric8.kubernetes-client>
|
||||
<io.github.mweirauch.micrometer-jvm-extras.version>0.2.2</io.github.mweirauch.micrometer-jvm-extras.version>
|
||||
<io.jaegertracing.micrometer.version>1.8.1</io.jaegertracing.micrometer.version>
|
||||
<io.jaegertracing.version>1.8.1</io.jaegertracing.version>
|
||||
|
|
@ -1413,7 +1413,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>kubernetes-client</artifactId>
|
||||
<artifactId>kubernetes-client-api</artifactId>
|
||||
<version>${io.fabric8.kubernetes-client}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
|
|
|
|||
Loading…
Reference in New Issue