Kind: correctly check KUBECONFIG when deleting clusters

Created on 11 Jan 2019  路  10Comments  路  Source: kubernetes-sigs/kind

This check is incomplete:
https://github.com/kubernetes-sigs/kind/blob/2b270a02556671be069c19c38a404a1eaf5951a9/pkg/cluster/context.go#L382-L385

Per [the official docs], KUBECONFIG may contain multiple paths. The current naive check is insufficient.

NOTE: this only affects wether we give help text or not, so it is not critical. But we should do the correct thing.

/priority backlog
/help

help wanted prioritbacklog

All 10 comments

@BenTheElder:
This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

This check is incomplete:
https://github.com/kubernetes-sigs/kind/blob/2b270a02556671be069c19c38a404a1eaf5951a9/pkg/cluster/context.go#L382-L385

Per [the official docs], KUBECONFIG may contain multiple paths. The current naive check is insufficient.

/priority backlog
/help

[the official docs]: https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#set-the-kubeconfig-environment-variable

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.

/assign

Hi, can I work on this issue?

/unassign
sure @manparvesh

@neolit123 thanks, I will assign it to myself
/assign

@manparvesh: GitHub didn't allow me to assign the following users: manparvesh.

Note that only kubernetes-sigs members and repo collaborators can be assigned and that issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

@neolit123 thanks, I will assign it to myself
/assign

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.

Oh, I can't do that. Can you please assign me this issue?
I am not sure how this works

you are not a member of the kubernetes-sigs organization so you cannot be assigned.
just sent a PR, thanks.

/lifecycle active

Oh I understand. I will send a PR.
Thanks

Thanks for the PR :-) this check should be much better when the user uses multiple KUBECONFIG 馃帀

For future reference there is an edgecase now around partial match where the file name later for some reason becomes a directory and is referenced in KUBECONFIG, but this case seems pretty unlikely...

We could get arbitrarily complex with this check (what about if there's a different equivalent path strinf specifying the same file?) and it wouldn't really be worth it (I'm guessing, maybe we change our mind later based on usage) because it's just a helpful reminder and we can't check your other open terminals anyhow.

Hopefully it's good enough now 馃槃

Was this page helpful?
0 / 5 - 0 ratings