Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

Raise exception on duplicated name in kubeconfig #47

Merged
merged 1 commit into from
Feb 26, 2018

Conversation

roycaihw
Copy link
Member

Client should detect duplicated name when loading name-value based lists in kubeconfig: users, clusters, contexts. Currently if there are multiple value with same name, client-python will pick the first one, while client-go will pick the last.

fixes kubernetes-client/python#445

cc @brendandburns @mbohlool

@codecov-io
Copy link

codecov-io commented Feb 22, 2018

Codecov Report

Merging #47 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #47      +/-   ##
==========================================
+ Coverage   93.59%   93.64%   +0.05%     
==========================================
  Files          11       11              
  Lines         859      866       +7     
==========================================
+ Hits          804      811       +7     
  Misses         55       55
Impacted Files Coverage Δ
config/kube_config.py 92.05% <100%> (+0.19%) ⬆️
config/kube_config_test.py 92.51% <100%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9aed5ad...1c6be33. Read the comment docs.

@mbohlool
Copy link
Contributor

/lgtm

@mbohlool mbohlool merged commit 11da619 into kubernetes-client:master Feb 26, 2018
@roycaihw roycaihw deleted the config_dup branch February 26, 2018 23:35
k8s-github-robot pushed a commit to kubernetes/kubernetes that referenced this pull request May 19, 2018
Automatic merge from submit-queue (batch tested with PRs 63598, 63913, 63459, 63963, 60464). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Client-go raises error on duplicated name in kubeconfig

(for NamedCluster, NamedContext, NamedUser, NamedExtension)



**What this PR does / why we need it**:
Client should detect duplicated name when loading `name-value` based lists in kubeconfig: `users`, `clusters`, `contexts`. Currently if there are multiple value with same name, `client-python` will pick the first one, while `client-go` will pick the last.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
ref: kubernetes-client/python#445, kubernetes-client/python-base#47

**Special notes for your reviewer**:

**Release note**:

```release-note
kubectl and client-go now detects duplicated name for user, cluster and context when loading kubeconfig and reports error 
```

/sig api-machinery

cc @brendandburns @mbohlool
k8s-publishing-bot added a commit to kubernetes/client-go that referenced this pull request May 19, 2018
Automatic merge from submit-queue (batch tested with PRs 63598, 63913, 63459, 63963, 60464). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Client-go raises error on duplicated name in kubeconfig

(for NamedCluster, NamedContext, NamedUser, NamedExtension)

**What this PR does / why we need it**:
Client should detect duplicated name when loading `name-value` based lists in kubeconfig: `users`, `clusters`, `contexts`. Currently if there are multiple value with same name, `client-python` will pick the first one, while `client-go` will pick the last.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
ref: kubernetes-client/python#445, kubernetes-client/python-base#47

**Special notes for your reviewer**:

**Release note**:

```release-note
kubectl and client-go now detects duplicated name for user, cluster and context when loading kubeconfig and reports error
```

/sig api-machinery

cc @brendandburns @mbohlool

Kubernetes-commit: 7909712ca574c536901bc7858dfbf72a3a6ee7dd
sttts pushed a commit to sttts/client-go that referenced this pull request Jun 8, 2018
Automatic merge from submit-queue (batch tested with PRs 63598, 63913, 63459, 63963, 60464). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Client-go raises error on duplicated name in kubeconfig

(for NamedCluster, NamedContext, NamedUser, NamedExtension)

**What this PR does / why we need it**:
Client should detect duplicated name when loading `name-value` based lists in kubeconfig: `users`, `clusters`, `contexts`. Currently if there are multiple value with same name, `client-python` will pick the first one, while `client-go` will pick the last.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
ref: kubernetes-client/python#445, kubernetes-client/python-base#47

**Special notes for your reviewer**:

**Release note**:

```release-note
kubectl and client-go now detects duplicated name for user, cluster and context when loading kubeconfig and reports error
```

/sig api-machinery

cc @brendandburns @mbohlool

Kubernetes-commit: 7909712ca574c536901bc7858dfbf72a3a6ee7dd
k8s-publishing-bot added a commit to kubernetes/client-go that referenced this pull request Jun 8, 2018
Automatic merge from submit-queue (batch tested with PRs 63598, 63913, 63459, 63963, 60464). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Client-go raises error on duplicated name in kubeconfig

(for NamedCluster, NamedContext, NamedUser, NamedExtension)

**What this PR does / why we need it**:
Client should detect duplicated name when loading `name-value` based lists in kubeconfig: `users`, `clusters`, `contexts`. Currently if there are multiple value with same name, `client-python` will pick the first one, while `client-go` will pick the last.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
ref: kubernetes-client/python#445, kubernetes-client/python-base#47

**Special notes for your reviewer**:

**Release note**:

```release-note
kubectl and client-go now detects duplicated name for user, cluster and context when loading kubeconfig and reports error
```

/sig api-machinery

cc @brendandburns @mbohlool

Kubernetes-commit: 7909712ca574c536901bc7858dfbf72a3a6ee7dd
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

python kubeconfig loading doesn't match kubectl config loading...
3 participants