Skip to content

Commit

Permalink
deps: bump Kubernetes Client from 6.13.1 to 7.0.0 (#396)
Browse files Browse the repository at this point in the history
* deps: bump Kubernetes Client from 6.13.1 to 7.0.0

* fix: don't run helm native goals in unsupported OS

* temp: temporarily disable kubernetes client JUnit
  • Loading branch information
manusa authored Dec 9, 2024
1 parent 02131b0 commit fe18ebe
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
path: ./it/target/jkube-test-report.txt

minikube-legacy:
name: K8S
name: K8S (Minikube Legacy)
needs: build-jkube
runs-on: ubuntu-20.04
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
- main
pull_request:
schedule:
- cron: '0 1 * * *' # Everyday at 1
- cron: '0 1 * * *' # Every day at 1

permissions:
contents: read
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static void printDiagnosis(JKubeCase jKubeCase) throws IOException, InterruptedE
System.err.println(pod.getStatus());
System.err.println("---------------------------");
});
if (jKubeCase.getKubernetesClient().isAdaptable(OpenShiftClient.class)) {
if (jKubeCase.getKubernetesClient().adapt(OpenShiftClient.class).supports(Route.class)) {
final OpenShiftClient oc = jKubeCase.getKubernetesClient().adapt(OpenShiftClient.class);
System.err.println("\n\n===========================");
System.err.println("\nDeployment:");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;

import java.io.ByteArrayOutputStream;
import java.io.File;
Expand Down Expand Up @@ -118,6 +119,7 @@ void k8sHelmPush() throws Exception {

@Test
@DisplayName("k8s:helm-uninstall, no release present, display error message")
@DisabledIfEnvironmentVariable(named = "ImageOS", matches = "ubuntu20")
void k8sHelmUninstall_whenNoReleasePresent_thenErrorMessageDisplayed() throws Exception {
// Given
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
Expand All @@ -133,6 +135,7 @@ void k8sHelmUninstall_whenNoReleasePresent_thenErrorMessageDisplayed() throws Ex
@Test
@Order(4)
@DisplayName("k8s:helm-install, should install the charts")
@DisabledIfEnvironmentVariable(named = "ImageOS", matches = "ubuntu20")
void k8sHelmInstall() throws Exception {
// Given
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
Expand All @@ -150,6 +153,7 @@ void k8sHelmInstall() throws Exception {
@Test
@Order(5)
@DisplayName("k8s:helm-uninstall, should uninstall the charts")
@DisabledIfEnvironmentVariable(named = "ImageOS", matches = "ubuntu20")
void k8sHelmUninstall() throws Exception {
// Given
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;

import java.io.ByteArrayOutputStream;
import java.io.File;
Expand Down Expand Up @@ -101,6 +102,7 @@ void ocHelm() throws Exception {
@Test
@Order(3)
@DisplayName("oc:helm-push, should push the charts")
@DisabledIfEnvironmentVariable(named = "ImageOS", matches = "ubuntu20")
void ocHelmPush() throws Exception {
// Given
final Properties properties = properties(
Expand All @@ -120,6 +122,7 @@ void ocHelmPush() throws Exception {

@Test
@DisplayName("oc:helm-uninstall, no release present, display error message")
@DisabledIfEnvironmentVariable(named = "ImageOS", matches = "ubuntu20")
void ocHelmUninstall_whenNoReleasePresent_thenErrorMessageDisplayed() throws Exception {
// Given
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
Expand All @@ -135,6 +138,7 @@ void ocHelmUninstall_whenNoReleasePresent_thenErrorMessageDisplayed() throws Exc
@Test
@Order(4)
@DisplayName("oc:helm-install, should install the charts")
@DisabledIfEnvironmentVariable(named = "ImageOS", matches = "ubuntu20")
void ocHelmInstall() throws Exception {
// Given
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
Expand All @@ -152,6 +156,7 @@ void ocHelmInstall() throws Exception {
@Test
@Order(5)
@DisplayName("oc:helm-uninstall, should uninstall the charts")
@DisabledIfEnvironmentVariable(named = "ImageOS", matches = "ubuntu20")
void ocHelmUninstall() throws Exception {
// Given
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io.fabric8.junit.jupiter.api.KubernetesTest;
import io.fabric8.kubernetes.api.model.Pod;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClientBuilder;
import org.eclipse.jkube.integrationtests.JKubeCase;

import java.io.File;
Expand All @@ -32,7 +33,7 @@
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.not;

@KubernetesTest(createEphemeralNamespace = false)
//@KubernetesTest(createEphemeralNamespace = false)
abstract class ZeroConfig implements JKubeCase {

protected static final String MAVEN_APPLICATION = "spring-boot-zero-config";
Expand All @@ -43,7 +44,8 @@ abstract class ZeroConfig implements JKubeCase {

@Override
public KubernetesClient getKubernetesClient() {
return kubernetesClient;
// TODO: REMOVE
return new KubernetesClientBuilder().build();
}

final Pod assertThatShouldApplyResources() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
*/
package org.eclipse.jkube.integrationtests.windows;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import io.fabric8.kubernetes.client.utils.HttpClientUtils;
import org.apache.maven.shared.invoker.InvocationResult;
import org.apache.maven.shared.invoker.MavenInvocationException;
import org.eclipse.jkube.integrationtests.jupiter.api.DockerRegistry;
Expand All @@ -34,6 +32,7 @@
import java.nio.file.Files;
import java.util.Collections;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -97,11 +96,15 @@ void k8sPush() throws Exception {
final InvocationResult invocationResult = maven("k8s:push", properties);
// Then
assertInvocation(invocationResult);
final Response response = new OkHttpClient.Builder().build().newCall(new Request.Builder()
.get().url("http://localhost:5000/v2/integration-tests/windows/tags/list").build())
.execute();
assertThat(response.body().string(),
containsString("{\"name\":\"integration-tests/windows\",\"tags\":[\"latest\"]}"));
final var httpFactory = HttpClientUtils.getHttpClientFactory();
try (final var http = httpFactory.newBuilder().build()) {
final var req = http.newHttpRequestBuilder().uri("http://localhost:5000/v2/integration-tests/windows/tags/list")
.build();
final var res = http.sendAsync(req, String.class).get(10, TimeUnit.SECONDS);
assertThat(res.isSuccessful(), equalTo(true));
assertThat(res.bodyString(),
containsString("{\"name\":\"integration-tests/windows\",\"tags\":[\"latest\"]}"));
}
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<camel.version>2.25.4</camel.version>
<com.fasterxml.jackson.core.version>2.15.2</com.fasterxml.jackson.core.version>
<com.fasterxml.jackson.dataformat.yaml.version>2.15.2</com.fasterxml.jackson.dataformat.yaml.version>
<fabric8.kubernetes-client.version>6.13.1</fabric8.kubernetes-client.version>
<fabric8.kubernetes-client.version>7.0.0</fabric8.kubernetes-client.version>
<guava.version>32.1.2-jre</guava.version> <!-- Required by Gradle Test Toolkit (testkit) -->
<gradle.version>8.7</gradle.version>
<gradle-api-maven-plugin-version>0.0.3</gradle-api-maven-plugin-version>
Expand Down

0 comments on commit fe18ebe

Please sign in to comment.