Skip to content

Commit

Permalink
feat: user Vert.x as the default HttpClient implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <[email protected]>
  • Loading branch information
manusa committed Nov 25, 2024
1 parent a45d956 commit b30ed87
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-httpclient-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
fail-fast: false
matrix:
kubernetes: [v1.28.1,v1.27.5]
httpclient: [jdk,jetty,vertx]
httpclient: [jdk,jetty,okhttp]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
* Fix #6158: Removed deprecated methods from `io.fabric8.kubernetes.client.utils.IOHelpers` class
* Fix #6159: Removed deprecated `io.fabric8.kubernetes.client.utils.Utils.getPluralFromKind` method
* Fix #6361: Renamed SettableBeanPropertyDelegate to SettableBeanPropertyDelegating
* Fix #6470: Switched default HTTP client from OkHttp to Vert.x (`kubernetes-httpclient-vertx`)
* Fix #6603: Removed deprecated `io.fabric8.openshift.api.model.runtime.RawExtension` class
* Fix #6605: Removed deprecated `ApiVersionUtil` classes in extension modules
* Fix #6609: Removed deprecated `io.fabric8.crd.generator.CRDInfo.getVersion` method
Expand Down
4 changes: 2 additions & 2 deletions chaos-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
<exclusions>
<exclusion>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-httpclient-okhttp</artifactId>
<artifactId>kubernetes-httpclient-vertx</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-httpclient-okhttp</artifactId>
<artifactId>kubernetes-httpclient-vertx</artifactId>
<scope>test</scope>
</dependency>

Expand Down
148 changes: 99 additions & 49 deletions doc/FAQ.md

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions doc/MIGRATION-v7.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Contents
- [Java baseline set to Java 11](#java-11)
- [Vert.x as default HttpClient implementation](#vertx-httpclient)
- [Bouncy Castle is no longer needed](#bouncy-castle)
- [Config changes](#config-changes)
- [Support for multiple kubeconfig files](#config-changes-multiple-kubeconfig)
Expand Down Expand Up @@ -41,6 +42,14 @@ Starting from version 7.0.0, you will need a Java 11+ runtime (using the latest
It's been more than 10 years since Java 8 was released, and it's no longer supported by most vendors.
We made our best effort to keep the client compatible with Java 8 for as long as possible, but it's time to move on.

## Vert.x as default HttpClient implementation <a href="#vertx-httpclient" id="vertx-httpclient"/>

OkHttp has been replaced by Vert.x as the default HttpClient implementation.
As of version 7.0.0, the Fabric8 Kubernetes Client `io.fabric8:kubernetes-client` and `io.fabric8:openshift-client` include a transitive dependency to the `io.fabric8:kubernetes-httpclient-vertx` module.

If you want to continue using OkHttp as the HttpClient, you can do so by adding the `io.fabric8:kubernetes-httpclient-okhttp` module as a dependency.
It is also recommended (although not mandatory) to add an exclusion for the `io.fabric8:kubernetes-httpclient-vertx` module to avoid having both implementations in the classpath.

## Bouncy Castle is no longer needed <a href="#bouncy-castle" id="bouncy-castle"/>

The Bouncy Castle library is no longer needed as a dependency.
Expand Down
4 changes: 2 additions & 2 deletions kubernetes-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-httpclient-okhttp</artifactId>
<artifactId>kubernetes-httpclient-vertx</artifactId>
<scope>runtime</scope>
</dependency>

Expand Down Expand Up @@ -205,7 +205,7 @@
</goals>
<configuration>
<excludeDependencies>
kubernetes-httpclient-okhttp
kubernetes-httpclient-vertx
</excludeDependencies>
<instructions>
<Bundle-Name>${project.name}</Bundle-Name>
Expand Down
10 changes: 5 additions & 5 deletions kubernetes-itests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<exclusions>
<exclusion>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-httpclient-okhttp</artifactId>
<artifactId>kubernetes-httpclient-vertx</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand All @@ -122,7 +122,7 @@
<exclusions>
<exclusion>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-httpclient-okhttp</artifactId>
<artifactId>kubernetes-httpclient-vertx</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand All @@ -133,7 +133,7 @@
</dependencies>
</profile>
<profile>
<id>httpclient-vertx</id>
<id>httpclient-okhttp</id>
<dependencies>
<dependency>
<groupId>io.fabric8</groupId>
Expand All @@ -142,13 +142,13 @@
<exclusions>
<exclusion>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-httpclient-okhttp</artifactId>
<artifactId>kubernetes-httpclient-vertx</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-httpclient-vertx</artifactId>
<artifactId>kubernetes-httpclient-okhttp</artifactId>
</dependency>
</dependencies>
</profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import io.fabric8.kubernetes.client.utils.InputStreamPumper;
import io.fabric8.kubernetes.client.utils.Utils;
import io.fabric8.mockwebserver.internal.WebSocketMessage;
import okio.ByteString;
import org.awaitility.Awaitility;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -830,7 +829,7 @@ void testPortForward() throws IOException {
} while (read >= 0);
buffer.flip();
channel.socket().close();
assertEquals("Hello World", ByteString.of(buffer).utf8());
assertEquals("Hello World", StandardCharsets.UTF_8.decode(buffer).toString());
assertFalse(portForward.errorOccurred());
assertEquals(0, portForward.getClientThrowables().size());
assertEquals(0, portForward.getServerThrowables().size());
Expand Down

0 comments on commit b30ed87

Please sign in to comment.