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

fix #3865: using just a single builder #3931

Merged
merged 3 commits into from
Mar 8, 2022
Merged

Conversation

shawkins
Copy link
Contributor

@shawkins shawkins commented Mar 4, 2022

Description

Removes the use of the OpenShiftClientBuilder and documents the use of KubernetesClientBuilder. Uses the same reflection strategy as KubernetesResourceUtil, but I didn't create a utility method for it just yet.

So the only odd man out is HttpClientUtils.createHttpClient since it only uses the thread context classloader - but I believe that is ok for now as at worst all someone would need to do is set an appropriate context class loader or set the httpclient.factory on the client builder. We should be able in subsequent releases move the logic from HttpClientUtils to the Kubernetes client factory to keep all in one place.

Depending upon the outcome of #3922 we can probably add a build(Class) shortcut for build().adapt(Class).

This also builds upon 0ca1325 to change OpenShiftConfig to just a decorator on a base config - no state can be lost if an openshiftconfig is inadvertently converted to base config.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • Code contributed by me aligns with current project license: Apache 2.0
  • I Added CHANGELOG entry regarding this change
  • I have implemented unit tests to cover my changes
  • I have added/updated the javadocs and other documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

@shawkins shawkins requested review from manusa and rohanKanojia March 4, 2022 14:42
@shawkins shawkins force-pushed the client branch 2 times, most recently from 462d82d to 930cada Compare March 4, 2022 15:52
Comment on lines 258 to 265
* <pre>
* {
* &#64;code
* Config configFromBuilder = new ConfigBuilder(Config.empty())
* // ...
* .build();
* }
* </pre>
Copy link
Member

Choose a reason for hiding this comment

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

So my assumption is incorrect...
#3913 (comment)

We need to change the formatter configuration to prevent this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added a commit do this. It's org.eclipse.jdt.core.formatter.comment.format_source_comment = false that we need. However by itself that didn't seem to work for me. So I imported/exported a full config and that seemed to work.

Copy link
Member

Choose a reason for hiding this comment

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

The correct option is org.eclipse.jdt.core.formatter.comment.format_source_code, which is working now: https://github.com/fabric8io/kubernetes-client/runs/5462546383?check_suite_focus=true

@manusa manusa added this to the 6.0.0 milestone Mar 8, 2022
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 8, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 15 Code Smells

48.0% 48.0% Coverage
0.0% 0.0% Duplication

@manusa manusa merged commit c7c0eb7 into fabric8io:master Mar 8, 2022
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