Skip to content

Commit f6f672e

Browse files
committed
[JENKINS-70493] Disable Kubernetes client autoconfiguration when an URL is provided
Otherwise the TokenRefreshInterceptor issues config.refresh(), which takes autoconfiguration first instead of keeping the initially provided configuration.
1 parent 43e9e49 commit f6f672e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/main/java/org/csanchez/jenkins/plugins/kubernetes/KubernetesFactoryAdapter.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,8 @@ public KubernetesClient createClient() throws KubernetesAuthException {
107107
LOGGER.log(FINE, "Autoconfiguring Kubernetes client");
108108
builder = new ConfigBuilder(Config.autoConfigure(null));
109109
} else {
110-
// although this will still autoconfigure based on Config constructor notes
111-
// In future releases (2.4.x) the public constructor will be empty.
112-
// The current functionality will be provided by autoConfigure().
113-
// This is a necessary change to allow us distinguish between auto configured values and builder values.
114-
builder = new ConfigBuilder().withMasterUrl(serviceAddress);
110+
// Using Config.empty() disables autoconfiguration
111+
builder = new ConfigBuilder(Config.empty()).withMasterUrl(serviceAddress);
115112
}
116113

117114
if (auth != null) {

0 commit comments

Comments
 (0)