-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the io.fabric8.kubernetes-client dependency from 6.10.0 to the latest 7.1.0 #774
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: vinokurig The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
72e34b0
to
55312a2
Compare
@@ -59,15 +59,16 @@ | |||
<com.googlecode.gson.version>2.10.1</com.googlecode.gson.version> | |||
<com.h2database.version>2.2.224</com.h2database.version> | |||
<com.jcraft.jsch.version>0.1.55</com.jcraft.jsch.version> | |||
<com.squareup.okhttp3.version>4.12.0</com.squareup.okhttp3.version> | |||
<com.squareup.okhttp3.version>5.0.0-alpha.12</com.squareup.okhttp3.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we really use alpha here? cc: @manusa
maybe we should also consider switching to another client - https://blog.marcnuri.com/kubernetes-client-6-httpclient-how-to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in version 7 the default client is no longer OkHttp but Vertx:
- https://blog.marcnuri.com/fabric8-kubernetes-client-7-0#vertx-as-default-httpclient-implementation
- https://github.com/fabric8io/kubernetes-client/blob/main/doc/MIGRATION-v7.md#vertx-httpclient
You no longer need a dependency to OkHttp unless you actually do the opposite that's explained in the referenced blog post.
To be clear, OkHttp and any reference should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still need the com.squareup.okhttp3:mockwebserver
dependency, otherwise I get the test compilation error:
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/ivinokur/projects/che-server/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/configurator/SshKeysConfiguratorTest.java:[62,21] cannot access org.junit.rules.ExternalResource
class file for org.junit.rules.ExternalResource not found
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
The test is failing on kubernetes initialisation step:
Line 62 in dd873a5
kubernetesServer.before(); |
According to square/okhttp#7987 (comment) we need the com.squareup.okhttp3:mockwebserver
dependency to use the junit 5 module.
@manusa could you please take a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not be using ExternalResource (it's JUnit4)
Switch to use the @EnableKubernetesMockClient(crud = true)
For some reason you're using a very convoluted way to set up the mock server in your tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want, I can update this test in a separate PR so you can follow the pattern for any other test doing the same weird setup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch to use the @EnableKubernetesMockClient(crud = true)
Unfortunately @EnableKubernetesMockClient
did not work for me.
If you want, I can update this test in a separate PR so you can follow the pattern for any other test doing the same weird setup
Thank you, that would be much appreciated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you're not using JUnit (neither 4 or 5) but TestNG instead.
I'll make another set of updates that should be v7-compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created #776
Once merged, you should rebase this PR and replace okhttp3.mockwebserver.MockWebServer
with io.fabric8.mockwebserver.MockWebServer
----> No OkHttp dependency should remain.
core/che-core-metrics-core/pom.xml
Outdated
<dependency> | ||
<groupId>com.squareup.okhttp3</groupId> | ||
<artifactId>okhttp</artifactId> | ||
<artifactId>okhttp-jvm</artifactId> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pom.xml
Outdated
<com.squareup.okio.version>3.6.0</com.squareup.okio.version> | ||
<commons-fileupload.version>1.5</commons-fileupload.version> | ||
<commons-io.version>2.14.0</commons-io.version> | ||
<commons-lang.version>2.6</commons-lang.version> | ||
<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>6.10.0</io.fabric8.kubernetes-client> | ||
<io.fabric8.kubernetes-client.version>7.1.0</io.fabric8.kubernetes-client.version> | ||
<io.fabric8.openshift-server-mock.version>6.13.5</io.fabric8.openshift-server-mock.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should remove this.
OpenShift Mock Server is not needed, you should switch to the vanilla Kubernetes Mock Server.
If you have trouble migrating, give me an example file and I'll show you the exact replacements you need to perform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
pom.xml
Outdated
<dependency> | ||
<groupId>com.squareup.okhttp3</groupId> | ||
<artifactId>okhttp-jvm</artifactId> | ||
<version>${com.squareup.okhttp3.version}</version> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pom.xml
Outdated
<dependency> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>openshift-server-mock</artifactId> | ||
<version>${io.fabric8.kubernetes-client}</version> | ||
<version>${io.fabric8.openshift-server-mock.version}</version> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
… to the latest 7.1.0
@vinokurig: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What does this PR do?
Update the io.fabric8.kubernetes-client dependency from 6.10.0 to the latest 7.1.0
Screenshot/screencast of this PR
What issues does this PR fix or reference?
How to test this PR?
N/A
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedRelease Notes
Reviewers
Reviewers, please comment how you tested the PR when approving it.