Skip to content

Commit cad2816

Browse files
committed
[FLINK-36332] use a property to select the httpclient implementation.
Default to okhttp for consistency with the previous model.
1 parent b3b45ba commit cad2816

File tree

2 files changed

+39
-10
lines changed

2 files changed

+39
-10
lines changed

flink-kubernetes-operator/pom.xml

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,21 @@ under the License.
3838
<!-- required by FlinkConfigManagerTest -->
3939
--add-opens=java.base/java.util=ALL-UNNAMED
4040
</surefire.module.config>
41+
<!-- valid options can be checked at https://central.sonatype.com/search?q=kubernetes-httpclient- currently: okhttp, jdk, jetty, vertx -->
42+
<fabric8.httpclinent.impl>okhttp</fabric8.httpclinent.impl>
4143
</properties>
4244

4345
<dependencies>
4446
<dependency>
4547
<groupId>io.javaoperatorsdk</groupId>
4648
<artifactId>operator-framework</artifactId>
4749
<version>${operator.sdk.version}</version>
50+
<exclusions>
51+
<exclusion>
52+
<groupId>io.fabric8</groupId>
53+
<artifactId>kubernetes-httpclient-okhttp</artifactId>
54+
</exclusion>
55+
</exclusions>
4856
</dependency>
4957

5058
<dependency>
@@ -60,25 +68,23 @@ under the License.
6068
</dependency>
6169

6270
<dependency>
71+
<!-- https://github.com/fabric8io/kubernetes-client/blob/main/doc/FAQ.md#what-artifacts-should-my-project-depend-on-->
6372
<groupId>io.fabric8</groupId>
64-
<artifactId>kubernetes-httpclient-okhttp</artifactId>
73+
<artifactId>kubernetes-httpclient-${fabric8.httpclinent.impl}</artifactId>
6574
<version>${fabric8.version}</version>
6675
<exclusions>
6776
<exclusion>
6877
<groupId>com.squareup.okhttp3</groupId>
69-
<artifactId>*</artifactId>
78+
<artifactId>okhttp</artifactId>
7079
</exclusion>
7180
</exclusions>
7281
</dependency>
82+
7383
<dependency>
74-
<groupId>com.squareup.okhttp3</groupId>
75-
<artifactId>okhttp</artifactId>
76-
<version>${okhttp.version}</version>
77-
</dependency>
78-
<dependency>
79-
<groupId>com.squareup.okhttp3</groupId>
80-
<artifactId>logging-interceptor</artifactId>
81-
<version>${okhttp.version}</version>
84+
<groupId>org.jetbrains</groupId>
85+
<artifactId>annotations</artifactId>
86+
<version>${jetbrains.annotations.version}</version>
87+
<scope>provided</scope>
8288
</dependency>
8389

8490
<!-- Flink -->
@@ -174,6 +180,12 @@ under the License.
174180
<artifactId>kubernetes-server-mock</artifactId>
175181
<version>${fabric8.version}</version>
176182
<scope>test</scope>
183+
<exclusions>
184+
<exclusion>
185+
<groupId>com.squareup.okhttp3</groupId>
186+
<artifactId>mockwebserver</artifactId>
187+
</exclusion>
188+
</exclusions>
177189
</dependency>
178190

179191
<dependency>
@@ -413,6 +425,22 @@ under the License.
413425
</plugins>
414426
</build>
415427
</profile>
428+
<profile>
429+
<id>depend-on-okhttp4</id>
430+
<activation>
431+
<property>
432+
<name>fabric8.httpclinent.impl</name>
433+
<value>okhttp</value>
434+
</property>
435+
</activation>
436+
<dependencies>
437+
<dependency>
438+
<groupId>com.squareup.okhttp3</groupId>
439+
<artifactId>okhttp</artifactId>
440+
<version>${okhttp.version}</version>
441+
</dependency>
442+
</dependencies>
443+
</profile>
416444
</profiles>
417445

418446
</project>

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ under the License.
110110
<surefire.module.config/>
111111

112112
<derby.version>10.15.2.0</derby.version>
113+
<jetbrains.annotations.version>24.1.0</jetbrains.annotations.version>
113114
</properties>
114115

115116
<dependencyManagement>

0 commit comments

Comments
 (0)