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

Client-go raises error on duplicated name in kubeconfig #60464

Merged
merged 1 commit into from May 19, 2018

Conversation

@roycaihw
Copy link
Member

roycaihw commented Feb 27, 2018

(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:

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

@mbohlool

This comment has been minimized.

Copy link
Member

mbohlool commented Apr 27, 2018

/lgtm /approve

@roycaihw

This comment has been minimized.

Copy link
Member Author

roycaihw commented Apr 27, 2018

/assign @krousey for approval

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Apr 27, 2018

@roycaihw: GitHub didn't allow me to assign the following users: for, approval.

Note that only kubernetes members and repo collaborators can be assigned.

In response to this:

/assign @krousey for approval

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.

@roycaihw

This comment has been minimized.

Copy link
Member Author

roycaihw commented May 4, 2018

@caesarxuchao for approval

}

_, err = LoadFromFile(configFile.Name())
if err == nil {

This comment has been minimized.

@caesarxuchao

caesarxuchao May 19, 2018

Member

Also check the error message? Same for the other tests.

- cluster:
api-version: v1
server: https://kubernetes.default.svc:443
certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt

This comment has been minimized.

@caesarxuchao

caesarxuchao May 19, 2018

Member

Could you change the api-version, server, and certificate-authority? We want to make sure an error is returned even if name is the only duplicate bit.

Same for the other tests.

@roycaihw roycaihw force-pushed the roycaihw:loadconfig branch from 5f288c2 to 8515802 May 19, 2018

Raise error on duplicate name in kubeconfig
for NamedCluster, NamedContext, NamedUser, NamedExtension

@roycaihw roycaihw force-pushed the roycaihw:loadconfig branch from 8515802 to e9454a3 May 19, 2018

@roycaihw

This comment has been minimized.

Copy link
Member Author

roycaihw commented May 19, 2018

@caesarxuchao Updated

@caesarxuchao

This comment has been minimized.

Copy link
Member

caesarxuchao commented May 19, 2018

/lgtm
/approve

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented May 19, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: caesarxuchao, mbohlool, roycaihw

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fejta-bot

This comment has been minimized.

Copy link

fejta-bot commented May 19, 2018

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

1 similar comment
@fejta-bot

This comment has been minimized.

Copy link

fejta-bot commented May 19, 2018

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@k8s-github-robot

This comment has been minimized.

Copy link
Contributor

k8s-github-robot commented 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 here.

@k8s-github-robot k8s-github-robot merged commit 7909712 into kubernetes:master May 19, 2018

18 checks passed

Submit Queue Queued to run github e2e tests a second time.
Details
cla/linuxfoundation roycaihw authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gke Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped
pull-kubernetes-local-e2e-containerized Skipped
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.