Skip to content
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

[issue 1269] (2.0.x) Bumping Fabric8 version to 6.9.2 #1296

Merged
merged 21 commits into from
Mar 11, 2024

Conversation

fabiobrz
Copy link
Collaborator

@fabiobrz fabiobrz commented Dec 6, 2023

Short description of what this resolves:

Upgrading the Fabric8 Kubernetes client to 6.9.2, non-disruptive approach.
Can be improved after further analysis and experiments.

CC @rsearls, @jimma, @gaol

Changes proposed in this pull request:

  • import packages refactoring
  • changes to align the implementation that uses the component with the latest APIs

Fixes #1269
@rsearls this also required the fixes for many issues that you have logged separately. How do we deal with such changes?

Draft: still having some issues with the Istio extension (currently commented) and there are TODO - check occurrences, that need to be resolved.

Some remarks and trackers:

  1. Internal changes regarding Istio integration: the Istio client implementation moved within the Fabric8 K8s Client project and evolved. So we had to adjust the integration in order to be aligned with the new semantics: IstioClientAdapter has been created to adapt the original K8s client. This adapter implements IstioClient and a concrete instance of it is injected by IstioAssistantCreatorinto the IstioAssistant instance. This last one represents the main entry point to the integration, and the APIs that exposes have been kept unchanged, apart for one caveat: resources can no longer be created with generic lists, but just with single definitions. A unit test has been added for the new IstioClientAdapter class.

  2. How we deal with HttpClient: now that the OkHttpClient impl is no longer exposed by the Fabric8 K8s Client, we made some changes, e.g.: here, which need to be double checked

  3. INameServicehas been added for ArqCubeNameService to implement it. It was used to be provided by ArqCubeNameServiceDescriptor with JDK 8, which was self registering via SPI by implementing sun.net.spi.nameservice.NameServiceDescriptor. This last one is internal and no longer available in JDK 11, so ArqCubeNameServiceDescriptor has been removed and ArqCubeNameService can be registered programmatically via INameService.install(new ArqCubeNameService()) - must be double checked and verified, see INameService Javadoc and the related test.

  4. GitHub CI worlflow: only JDK 11 enabled, JDK 8 to be verified. Category left as is (i.e. "docker", we should experiment with others)

  5. mvnw version: bumped to 3.9.6

  6. Mockito unnecessary stubs: now (with newer Mockito dependencies) those are traced as error that break the build, so we had to mark all of them via Mockito.lenient(), and we might want to log a follow up issue for detailed evaluation and removal

  7. arquillian.cube.docker.impl.client.config POJOs: (e.g.: ExposedPort.java, Link.java, etc.) have been modified to add a single argument ctor, otherwise YAML deserialization via newer jackson dependencies would fail.

  8. The podman unix socket is now used by DockerHealthAwaitStrategyTest:, raher than the docker one.

  9. MockTest.java: Changes have been made to the Kubernetes mock server in order to mock additional expectations required by the new client behavior

@fabiobrz fabiobrz marked this pull request as ready for review December 6, 2023 14:36
@fabiobrz fabiobrz changed the title [issues-1269] Bumping Fabric8 version to 6.9.2 [issues-1269] (2.0.x) Bumping Fabric8 version to 6.9.2 Dec 6, 2023
@fabiobrz fabiobrz force-pushed the 2.0.x-bump-fabric8-692 branch 9 times, most recently from bc5c1a3 to f2a551d Compare December 15, 2023 15:18
@fabiobrz fabiobrz changed the title [issues-1269] (2.0.x) Bumping Fabric8 version to 6.9.2 [issue 1269] (2.0.x) Bumping Fabric8 version to 6.9.2 Jan 10, 2024
Copy link
Collaborator

@jimma jimma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabiobrz Awesome work ! This looks good to me. Only some ideas/minor things about OKHttpClient:

  • Is it possible that we use jdk http client or url connection in IstioAssistant, then we don't need this okhttpclient dependency anymore?
  • For the okhttpclient in the test , can we simply replace it with `restassured' to easily check the json response ?

@fabiobrz
Copy link
Collaborator Author

  • Is it possible that we use jdk http client or url connection in IstioAssistant, then we don't need this okhttpclient dependency anymore?

  • For the okhttpclient in the test , can we simply replace it with `restassured' to easily check the json response ?

Thanks for your review @jimma! Sure. It makes sense to me, will have a look.

@fabiobrz
Copy link
Collaborator Author

Hi @jimma - some considerations/questions after a quick look:

* Is it possible that we use jdk http client or url connection in `IstioAssistant`, then we don't need this okhttpclient dependency anymore?

Are there any reasons for your question to address just IstioAssistant? We are creating instances via OkHttpClientFactoryin several places, what about them?

* For the  okhttpclient in the test , can we simply replace it with `restassured' to easily check the json response ?

Here too, is this just about some tests or all the tests?

@jimma
Copy link
Collaborator

jimma commented Jan 25, 2024

Hi @jimma - some considerations/questions after a quick look:

* Is it possible that we use jdk http client or url connection in `IstioAssistant`, then we don't need this okhttpclient dependency anymore?

Are there any reasons for your question to address just IstioAssistant? We are creating instances via OkHttpClientFactoryin several places, what about them?

I think less dependency is better. I only looked at IstioAssitant and didn't go through all classes which imports OKHttpClient class.

* For the  okhttpclient in the test , can we simply replace it with `restassured' to easily check the json response ?

Here too, is this just about some tests or all the tests?

I mean all the tests which relies on okttpclient to check the response. Is it doable ?

@fabiobrz
Copy link
Collaborator Author

Hi @jimma - some considerations/questions after a quick look:

* Is it possible that we use jdk http client or url connection in `IstioAssistant`, then we don't need this okhttpclient dependency anymore?

Are there any reasons for your question to address just IstioAssistant? We are creating instances via OkHttpClientFactoryin several places, what about them?

I think less dependency is better. I only looked at IstioAssitant and didn't go through all classes which imports OKHttpClient class.

Ok, so I'll figure out what it means to replace it with another implementation (e.g.: the JDK HttpClient).

* For the  okhttpclient in the test , can we simply replace it with `restassured' to easily check the json response ?

Here too, is this just about some tests or all the tests?

I mean all the tests which relies on okttpclient to check the response. Is it doable ?

Sure thing, that's actually one straightforward use case.

Hopefully I'll be able to get back soon about this, thanks.

…tional code and with rest-assured in test code
@fabiobrz
Copy link
Collaborator Author

fabiobrz commented Feb 8, 2024

Hi @jimma - I made an attempt to address your latest remarks:

  1. OkHttpClient has been replaced by JdkHttpClient in functional code, we only have one TBD here, regarding cookies manipulation when using a proxy, see https://github.com/fabiobrz/arquillian-cube/blob/2.0.x-bump-fabric8-692/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/fabric8/F8Proxy.java#L73
  2. OkHttpClient has been replaced by rest-assured where possible, the only exception is istio tests that use IstioAssistant for awaiting responses, since its methods expect for java.net request/response arguments now.

Copy link
Collaborator

@jimma jimma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabiobrz Thanks for this improvement. This looks good to merge.

@jimma
Copy link
Collaborator

jimma commented Feb 21, 2024

Hi @jimma - I made an attempt to address your latest remarks:

  1. OkHttpClient has been replaced by JdkHttpClient in functional code, we only have one TBD here, regarding cookies manipulation when using a proxy, see https://github.com/fabiobrz/arquillian-cube/blob/2.0.x-bump-fabric8-692/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/fabric8/F8Proxy.java#L73

I think JDK http client can support this too. Is there test or function requires this cookie thing ?

  1. OkHttpClient has been replaced by rest-assured where possible, the only exception is istio tests that use IstioAssistant for awaiting responses, since its methods expect for java.net request/response arguments now.

Could you please point me the test code for this exception ? Thanks.

@fabiobrz
Copy link
Collaborator Author

Hi @jimma

I think JDK http client can support this too. Is there test or function requires this cookie thing

Yes, there should be a CookieHandler/Manager or something similar.

Is there test or function requires this cookie thing ?

Yep, it seems to be used by the OpenShift client adapter via F8Proxy in the end... I'll have to look closer though.

Could you please point me the test code for this exception ?

Yup, see here, and here. As you can see the await would have to be modified to work with rest assured API, and it doesn't seem the case to me, since IstioAssistant is not a test component.

@jimma
Copy link
Collaborator

jimma commented Mar 8, 2024

@fabiobrz sorry for the late reply. These are all very minor issues. We can create some todo task for these things and merge your change. WDYT ?

@fabiobrz
Copy link
Collaborator Author

fabiobrz commented Mar 8, 2024

@fabiobrz sorry for the late reply. These are all very minor issues. We can create some todo task for these things and merge your change. WDYT ?

+1, thanks @jimma - I have filed #1297 for the cookie configuration TBD, while I actually think we should not do anything regarding IstioAssistant APIs, since those -being part of the functional implementation - should really not use rest-assured.

Feel free to merge, in case you don't have any objections.

@jimma jimma merged commit 187cc52 into arquillian:2.0.x Mar 11, 2024
1 check passed
starksm64 pushed a commit that referenced this pull request Apr 4, 2024
* [issues-1270] project made JDK- compileable. (#1293)

* [issue 1269] (2.0.x) Bumping Fabric8 version to 6.9.2 (#1296)

* [issues-1269] Bumping Fabric8 version to 6.9.2

* [issues-1269] Bump CI JDK version to 11

* [issues-1269] Bump Maven wrapper version to 3.9.6

* [issues-1269] Bump Wildfly Arquillian remote container dependency, which BTW is required to not pull in http repos, which would be blocked with Maven >= 3.8.1

* [issues-1269] Fixing the Timespan class in order to properly set TIME_UNIT_ORDER

* [issues-1269] Fixing the CubeCOnfiguration model that is no longer valid for SnakeYaml to load it without single argument constructors

* [issues-1269] Fixing the tests in core module

* [issues-1269] Fixing the tests in docker module

* [issues-1269] Fixing the tests in docker moduleù

* [issues-1269] Fixing the tests in kubernetes moduleù

* [issues-1269] Downgrade okhttp3 version to 3.12.12, to be compatible with the one used by Fabric8 Kubernetes client

* [issues-1269] - TEMP - Fixing hamcrest dependency artifactId and scope for Kubernetes and OpenShift modules

* [issues-1269] Fix Java custom DNS SPI removal

* [issues-1269] Fix Istio integration and tests

* [issues-1269] Fix KubernetesAssistant delete method return logic

* [issues-1269] Fixing sundr.io dependencies

* [issues-1269] - Adding the kubernetest-client depenency to kubernetes assistant functional tests

* [issues-1269] Removing TODOs

* [issue 1269] - Fixing MockTest.java

* [issue 1269] - Resume DockerHealthAwaitStrategyTest

* [issue 1269] - Remove okhttp, replacing it with JdkHtppClient in functional code and with rest-assured in test code

---------

Co-authored-by: Fabio Burzigotti <[email protected]>

---------

Co-authored-by: rsearls <[email protected]>
Co-authored-by: Fabio Burzigotti <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants