javascript icon indicating copy to clipboard operation
javascript copied to clipboard

No way to ignore duplicate cluster when loading config

Open datho7561 opened this issue 3 years ago • 6 comments

Describe the bug When loading the kubernetes configuration, there is no way to ignore duplicate cluster entries. I think this is a bug or a missing feature, since kubectl seems to work fine when there are duplicate cluster entries.

** Client Version ** 0.19.0

** Server Version ** 1.26.6

To Reproduce Have multiple config files configured using KUBECONFIG. Have an identical cluster in both config files.

Then, invoke new KubeConfig().loadFromDefault().

Expected behavior new KubeConfig().loadFromDefault() should filter duplicate entries, or provide an option in the parameters to filter out duplicate entries.

** Example Code** new KubeConfig().loadFromDefault()

Environment (please complete the following information):

  • OS: Linux
  • NodeJS Version: 18
  • Cloud runtime: ??? I have an OpenShift cluster

Additional context none

datho7561 avatar Oct 02 '23 14:10 datho7561

This client doesn't support multiple config files in general (see the code here: https://github.com/kubernetes-client/javascript/blob/master/src/config.ts#L129)

The logic for loading from multiple files is complicated and not specified anywhere except for in the Golang client. It probably should never have been a feature of kubectl but it's too late for that now.

If you write a PR with comprehensive unit tests that mimics the behavior of the golang code, we can consider accepting it into this client library, but it is unlikely to be implemented otherwise.

brendandburns avatar Oct 02 '23 15:10 brendandburns

Okay, thanks for the response. I'll work within this limitation for my use case.

datho7561 avatar Oct 02 '23 15:10 datho7561

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jan 29 '24 12:01 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Feb 28 '24 13:02 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Mar 29 '24 13:03 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Mar 29 '24 13:03 k8s-ci-robot