-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Describe the bug
I create a kube config in code with ConfigBuilder, and I don't want to load the default kube config file, so I use the withAutoConfig method of the ConfigBuilder to set the autoConfig to false, but it's not working, the default kube config file still loaded.
after inverstigate, I found the default constructor of the ConfigBuilder will create a new Config
public ConfigBuilder() {
this(new Config());
}below is the default constructor of the Config, It will get the autoConfig value from system properties or env, not from the configBuilder
@Deprecated
public Config() {
this(!disableAutoConfig());
}
private static boolean disableAutoConfig() {
return Utils.getSystemPropertyOrEnvVar(KUBERNETES_DISABLE_AUTO_CONFIG_SYSTEM_PROPERTY, false);
}Fabric8 Kubernetes Client version
6.12.1
Steps to reproduce
- make sure the default kubeConfig file exist and have some cluster configurations
- create a config with
ConfigBuilder, set the autoConfig to false - check the config object, it have configurations from the default kubeConfig file
Expected behavior
no default kubeConfig file loaded if autoConfig is false
Runtime
Kubernetes (vanilla)
Kubernetes API Server version
1.23
Environment
Windows
Fabric8 Kubernetes Client Logs
No response
Additional context
No response