-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 (kubernetes-client-api) : Config
's autoConfigure
should disable auto configuration
#6153
Conversation
3a2cfc5
to
c97e1e4
Compare
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.
Let's review this together after the stand-up, I'm not sure how these changes deal with the issue
c1a47c8
to
dbbe657
Compare
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.
Could you please create an initial PR with the tests so that it's clear that the changes in the constructor are not affecting the previous behavior.
7152199
to
7a3bd1d
Compare
OAuthTokenProvider oauthTokenProvider, Map<String, String> customHeaders, int requestRetryBackoffLimit, | ||
int requestRetryBackoffInterval, int uploadRequestTimeout, boolean onlyHttpWatches, NamedContext currentContext, | ||
List<NamedContext> contexts, boolean autoConfigure) { | ||
autoConfigure(this, null); |
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.
This looks weird. Why is autoconfigure always invoked? It wasn't before (in some of the methods)
this.apiVersion = Objects.equals(this.apiVersion, apiVersion) ? "v1" : apiVersion; | ||
this.namespace = Objects.equals(this.namespace, namespace) ? null : namespace; |
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.
these also look weird?
why is the variable overridden to an arbitrary (magic) value in case the current and provided values match?
952b090
to
d20f386
Compare
b8eca9b
to
b2e2a09
Compare
…le auto configuration `Config`'s autoConfigure field should behave as per expectations. We need to make changes to ConfigBuilder and ConfigFluent in order to achieve this. - Add a new Constructor with additional boolean arguments `autoConfigure` and `shouldSetDefaultValues` - Add a new class `SundrioConfig` that would extend `Config` for generating the Sundrio Builder for Config - Move generated classes `ConfigBuilder` and `ConfigFluent` to `src/main/java` - `ConfigBuilder` would extend generated SundrioConfigBuilder and override the `build()` method by calling `disableAutoConfig()` if `autoConfigure` is nto provided by the user. Earlier `ConfigBuidler` was calling `new Config()` (this was enabling auto configuration) - Make all fields in Config class use boxed types instead of primitive types so that we can distinguish whether they have been configured by user. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
b2e2a09
to
49cb4cb
Compare
|
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.
LGTM, thx!
Description
Fix #6137
Config
's autoConfigure field should behave as per expectations.We need to make changes to ConfigBuilder and ConfigFluent in order to achieve this.
autoConfigure
andshouldSetDefaultValues
SundrioConfig
that would extendConfig
for generating the Sundrio Builder for ConfigConfigBuilder
andConfigFluent
tosrc/main/java
ConfigBuilder
would extend generated SundrioConfigBuilder and override thebuild()
method by callingdisableAutoConfig()
ifautoConfigure
is not provided by the user. EarlierConfigBuidler
was callingnew Config()
(this was enabling auto configuration)Type of change
test, version modification, documentation, etc.)
Checklist