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

ConfigBuilder.withAutoConfigure is not working #6137

Closed
ttbadr opened this issue Jul 14, 2024 · 2 comments · Fixed by #6153
Closed

ConfigBuilder.withAutoConfigure is not working #6137

ttbadr opened this issue Jul 14, 2024 · 2 comments · Fixed by #6153
Assignees
Labels
Milestone

Comments

@ttbadr
Copy link
Contributor

ttbadr commented Jul 14, 2024

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

  1. make sure the default kubeConfig file exist and have some cluster configurations
  2. create a config with ConfigBuilder, set the autoConfig to false
  3. 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

@rohanKanojia
Copy link
Member

@ttbadr : Does it work if you provide Config.empty() inside ConfigBuilder like this?

@manusa manusa added Waiting on feedback Issues that require feedback from User/Other community members bug labels Jul 15, 2024
@ttbadr
Copy link
Contributor Author

ttbadr commented Jul 17, 2024

@ttbadr : Does it work if you provide Config.empty() inside ConfigBuilder like this?

great, It’s works for me

@manusa manusa removed the Waiting on feedback Issues that require feedback from User/Other community members label Jul 17, 2024
@rohanKanojia rohanKanojia self-assigned this Jul 18, 2024
@manusa manusa added this to the 7.0.0 milestone Aug 8, 2024 — with automated-tasks
dongjoon-hyun pushed a commit to apache/spark that referenced this issue Aug 12, 2024
### What changes were proposed in this pull request?
The pr aims to upgrade `kubernetes-client` from `6.13.1` to `6.13.2`.

### Why are the changes needed?
- The full release notes: https://github.com/fabric8io/kubernetes-client/releases/tag/v6.13.2
- The newest version fixed some bug, eg:
  Fix fabric8io/kubernetes-client#6066: Added support for missing v1.APIVersions in KubernetesClient
  Fix fabric8io/kubernetes-client#6110: VolumeSource (and other file mode fields) in Octal are correctly interpreted
  Fix fabric8io/kubernetes-client#6137: ConfigBuilder.withAutoConfigure is not working

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Pass GA.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes #47703 from panbingkun/SPARK-49196.

Authored-by: panbingkun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
IvanK-db pushed a commit to IvanK-db/spark that referenced this issue Sep 20, 2024
### What changes were proposed in this pull request?
The pr aims to upgrade `kubernetes-client` from `6.13.1` to `6.13.2`.

### Why are the changes needed?
- The full release notes: https://github.com/fabric8io/kubernetes-client/releases/tag/v6.13.2
- The newest version fixed some bug, eg:
  Fix fabric8io/kubernetes-client#6066: Added support for missing v1.APIVersions in KubernetesClient
  Fix fabric8io/kubernetes-client#6110: VolumeSource (and other file mode fields) in Octal are correctly interpreted
  Fix fabric8io/kubernetes-client#6137: ConfigBuilder.withAutoConfigure is not working

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Pass GA.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes apache#47703 from panbingkun/SPARK-49196.

Authored-by: panbingkun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
attilapiros pushed a commit to attilapiros/spark that referenced this issue Oct 4, 2024
### What changes were proposed in this pull request?
The pr aims to upgrade `kubernetes-client` from `6.13.1` to `6.13.2`.

### Why are the changes needed?
- The full release notes: https://github.com/fabric8io/kubernetes-client/releases/tag/v6.13.2
- The newest version fixed some bug, eg:
  Fix fabric8io/kubernetes-client#6066: Added support for missing v1.APIVersions in KubernetesClient
  Fix fabric8io/kubernetes-client#6110: VolumeSource (and other file mode fields) in Octal are correctly interpreted
  Fix fabric8io/kubernetes-client#6137: ConfigBuilder.withAutoConfigure is not working

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Pass GA.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes apache#47703 from panbingkun/SPARK-49196.

Authored-by: panbingkun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
himadripal pushed a commit to himadripal/spark that referenced this issue Oct 19, 2024
### What changes were proposed in this pull request?
The pr aims to upgrade `kubernetes-client` from `6.13.1` to `6.13.2`.

### Why are the changes needed?
- The full release notes: https://github.com/fabric8io/kubernetes-client/releases/tag/v6.13.2
- The newest version fixed some bug, eg:
  Fix fabric8io/kubernetes-client#6066: Added support for missing v1.APIVersions in KubernetesClient
  Fix fabric8io/kubernetes-client#6110: VolumeSource (and other file mode fields) in Octal are correctly interpreted
  Fix fabric8io/kubernetes-client#6137: ConfigBuilder.withAutoConfigure is not working

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Pass GA.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes apache#47703 from panbingkun/SPARK-49196.

Authored-by: panbingkun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment