This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git
The following commit(s) were added to refs/heads/main by this push:
new 991457c [SPARK-53650] Make `build.gradle` and `libs.versions.toml`
up-to-date with `okhttp3` usage
991457c is described below
commit 991457c8170cead0f1877414a51c9f4dc7d279be
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Fri Sep 19 16:06:36 2025 -0700
[SPARK-53650] Make `build.gradle` and `libs.versions.toml` up-to-date with
`okhttp3` usage
### What changes were proposed in this pull request?
This PR aims to validate and update the Gradle build dependencies in terms
of `okhttp3` library usage.
```
gradle/libs.versions.toml
spark-operator-api/build.gradle
spark-operator/build.gradle
```
### Why are the changes needed?
- As of now, `okhttp3` is a test dependency. So, we need to move `okhttp`
to the test dependency section like `junit`.
https://github.com/apache/spark-kubernetes-operator/blob/b0d7d9592ba15b37c067657c929d44f9c2ff5d88/gradle/libs.versions.toml#L21-L27
- Since SPARK-52005, `Apache Spark K8s Operator` is using `Apache Spark 4`
dependency which has no direct dependency to `okhttp3` library. So, we don't
need the following exclusion.
https://github.com/apache/spark-kubernetes-operator/blob/b0d7d9592ba15b37c067657c929d44f9c2ff5d88/spark-operator/build.gradle#L69
- Since `Fabric8` v7.0.0, `VertxHttpClientFactory` is the default so that
we don't need to exclude `okhttp3`. In addition, we migrated to use
`VertxHttpClientFactory` via SPARK-53648.
https://github.com/apache/spark-kubernetes-operator/blob/b0d7d9592ba15b37c067657c929d44f9c2ff5d88/spark-operator-api/build.gradle#L20-L23
### Does this PR introduce _any_ user-facing change?
No behavior change.
### How was this patch tested?
Pass the CIs and manual check.
**BEFORE**
```
$ git grep okhttp
gradle/libs.versions.toml:okhttp = "4.12.0"
gradle/libs.versions.toml:okhttp = { group = "com.squareup.okhttp3", name =
"okhttp", version.ref = "okhttp" }
gradle/libs.versions.toml:mockwebserver = { group = "com.squareup.okhttp3",
name = "mockwebserver", version.ref = "okhttp" }
spark-operator-api/build.gradle: exclude group: 'com.squareup.okhttp3'
spark-operator/build.gradle: exclude group: 'com.squareup.okhttp3'
spark-operator/build.gradle: exclude group: 'com.squareup.okhttp3'
spark-operator/build.gradle: exclude group: 'com.squareup.okhttp3'
```
**AFTER**
```
$ git grep okhttp
gradle/libs.versions.toml:okhttp = "4.12.0"
gradle/libs.versions.toml:mockwebserver = { group = "com.squareup.okhttp3",
name = "mockwebserver", version.ref = "okhttp" }
```
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #329 from dongjoon-hyun/SPARK-53650.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
gradle/libs.versions.toml | 3 +--
spark-operator-api/build.gradle | 4 +---
spark-operator/build.gradle | 5 -----
3 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 9d7a3a6..d1756b3 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -18,7 +18,6 @@
fabric8 = "7.4.0"
lombok = "1.18.38"
operator-sdk = "5.1.2"
-okhttp = "4.12.0"
dropwizard-metrics = "4.2.30"
spark = "4.0.1"
log4j = "2.24.3"
@@ -27,6 +26,7 @@ log4j = "2.24.3"
junit = "5.13.1"
jacoco = "0.8.13"
mockito = "5.18.0"
+okhttp = "4.12.0"
# Build Analysis
checkstyle = "10.23.1"
@@ -44,7 +44,6 @@ kubernetes-httpclient-vertx = { group = "io.fabric8", name =
"kubernetes-httpcli
kubernetes-server-mock = { group = "io.fabric8", name =
"kubernetes-server-mock", version.ref = "fabric8" }
kube-api-test-client-inject = {group = "io.fabric8", name =
"kube-api-test-client-inject", version.ref = "fabric8"}
crd-generator-apt = { group = "io.fabric8", name = "crd-generator-apt",
version.ref = "fabric8" }
-okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref =
"okhttp" }
mockwebserver = { group = "com.squareup.okhttp3", name = "mockwebserver",
version.ref = "okhttp" }
lombok = { group = "org.projectlombok", name = "lombok", version.ref =
"lombok" }
log4j-api = { group = "org.apache.logging.log4j", name = "log4j-api",
version.ref = "log4j" }
diff --git a/spark-operator-api/build.gradle b/spark-operator-api/build.gradle
index 8fe8b7a..de33545 100644
--- a/spark-operator-api/build.gradle
+++ b/spark-operator-api/build.gradle
@@ -18,9 +18,7 @@
*/
dependencies {
// fabric8
- implementation(libs.kubernetes.client) {
- exclude group: 'com.squareup.okhttp3'
- }
+ implementation(libs.kubernetes.client)
compileOnly(libs.crd.generator.apt)
annotationProcessor(libs.crd.generator.apt)
diff --git a/spark-operator/build.gradle b/spark-operator/build.gradle
index 466f96f..57f6d42 100644
--- a/spark-operator/build.gradle
+++ b/spark-operator/build.gradle
@@ -48,8 +48,6 @@ dependencies {
exclude group: "org.rocksdb"
exclude group: "org.slf4j"
exclude group: "org.xerial.snappy"
- exclude group: 'com.squareup.okhttp3'
- exclude group: 'com.squareup.okio'
}
compileOnly(libs.lombok)
@@ -62,11 +60,8 @@ dependencies {
}
testImplementation(libs.kubernetes.server.mock) {
exclude group: 'junit'
- exclude group: 'com.squareup.okhttp3'
}
testImplementation(libs.spark.core) {
- exclude group: 'com.squareup.okio'
- exclude group: 'com.squareup.okhttp3'
exclude group: "org.apache.logging.log4j"
exclude group: "org.slf4j"
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]