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

kubectl: migrate $HOME/.kube to $HOME/.config/kube #97885

Closed
wants to merge 1 commit into from
Closed

kubectl: migrate $HOME/.kube to $HOME/.config/kube #97885

wants to merge 1 commit into from

Conversation

dougsland
Copy link
Member

@dougsland dougsland commented Jan 10, 2021

kubectl: migrate $HOME/.kube to $HOME/.config/kube

This patch implements the migration config from $HOME/.kube to
use XDG Base Directory Specification. The recommended
path now will be $HOME/.config/kube.

KEP: kubernetes/enhancements#2111

Signed-off-by: Douglas Schilling Landgraf dougsland@redhat.com

@k8s-ci-robot
Copy link
Contributor

@dougsland: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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 k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jan 10, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dougsland
To complete the pull request process, please assign caesarxuchao after the PR has been reviewed.
You can assign the PR to them by writing /assign @caesarxuchao in a comment when ready.

The full list of commands accepted by this bot can be found 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

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 10, 2021
@dougsland
Copy link
Member Author

/sig cli

@k8s-ci-robot k8s-ci-robot added the sig/cli Categorizes an issue or PR as relevant to SIG CLI. label Jan 10, 2021
@dougsland
Copy link
Member Author

/retest

@dougsland
Copy link
Member Author

/test pull-kubernetes-e2e-gce-100-performance

@dougsland
Copy link
Member Author

/test pull-kubernetes-e2e-gce-ubuntu-containerd

@pacoxu
Copy link
Member

pacoxu commented Jan 10, 2021

/retest

1 similar comment
@dougsland
Copy link
Member Author

/retest

@rikatz
Copy link
Contributor

rikatz commented Jan 10, 2021

/kind feature
/priority backlog

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jan 10, 2021
@dougsland
Copy link
Member Author

/retest

1 similar comment
@dougsland
Copy link
Member Author

/retest

@dougsland
Copy link
Member Author

/retest

Copy link
Member

@liggitt liggitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/hold

this causes compatibility issues for client-go consumers

staging/src/k8s.io/client-go/tools/clientcmd/loader.go Outdated Show resolved Hide resolved
staging/src/k8s.io/client-go/tools/clientcmd/loader.go Outdated Show resolved Hide resolved
staging/src/k8s.io/client-go/tools/clientcmd/loader.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 12, 2021
@caesarxuchao
Copy link
Member

/cc @lavalamp
/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 12, 2021
@lavalamp
Copy link
Member

This migration seems super painful, what is the benefit? The KEP states that it's a non-goal to "Deprecate any file under $HOME/.kube/"? The KEP is also not merged yet?

@lavalamp
Copy link
Member

Even just adding a new place to search has the potential to be very confusing to users and e.g. change behavior should that "new" location somehow already exist on their system.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 13, 2021
@dougsland
Copy link
Member Author

Hi @lavalamp. Thanks for your review.

This migration seems super painful, what is the benefit?

Use the XDG Spec as must of programs use these days. Users have been asking. However, I will state all possibilities in the KEP in a few minutes as Jordan requested. They can even use:

 export KUBECONFIG=$HOME/.config/kube/config

The KEP states that it's a non-goal to "Deprecate any file under
$HOME/.kube/"?

Yes, the patch won't create new files names.

The KEP is also not merged yet?

No, people are reviewing.

@dougsland
Copy link
Member Author

Even just adding a new place to search has the potential to be very confusing to users and e.g. change behavior should that
"new" location somehow already exist on their system.

It should documented, also that's why we have this code in the patch reusing code:

-               data, err := ioutil.ReadFile(source)
+               config, err := LoadFromFile(source)
                if err != nil {
                        return err
                }
-               // destination is created with mode 0666 before umask
-               err = ioutil.WriteFile(destination, data, 0666)
+               err = WriteToFile(*config, destination)
                if err != nil {

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 13, 2021
This patch implement the migration config from $HOME/.kube to
use XDG Base Directory Specification. The recommended
path now will be $HOME/.config/kube.

KEP: kubernetes/enhancements#2111

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
@k8s-ci-robot
Copy link
Contributor

@dougsland: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubernetes-e2e-gce-ubuntu-containerd 67687a6 link /test pull-kubernetes-e2e-gce-ubuntu-containerd
pull-kubernetes-e2e-gce-100-performance 67687a6 link /test pull-kubernetes-e2e-gce-100-performance

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@lavalamp
Copy link
Member

I read the comments here, and I don't follow the argument for why the disruption is worth the benefit. I would vote against doing this.

Improving the existing documentation is fine.

@dougsland
Copy link
Member Author

dougsland commented Jan 20, 2021

adding some other folks from sig-cli to the thread:
/cc @pwittrock
/cc @rikatz

@liggitt
Copy link
Member

liggitt commented Jan 21, 2021

I read the comments here, and I don't follow the argument for why the disruption is worth the benefit. I would vote against doing this.

Improving the existing documentation is fine.

I agree with this.

@justinsb
Copy link
Member

I've previously asked for the ability to support a directory of per-cluster kubeconfigs. Perhaps we could support a directory of kubeconfigs under ~/.config/kube/?

@dougsland
Copy link
Member Author

I've previously asked for the ability to support a directory of per-cluster kubeconfigs. Perhaps we could support a
directory of kubeconfigs under ~/.config/kube/?

@justinsb that's a good idea.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 19, 2021
@dougsland
Copy link
Member Author

dougsland commented May 19, 2021

The k8s community decided to not move forward with the KEP regarding this PR.
Thanks everyone involved, closing the PR for now. Feel free to reach me via slack or email, if you have any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants