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

Ignore Kubernetes configuration file permission warnings when parsing version #1702

Closed
robinbraemer opened this issue Apr 18, 2024 · 2 comments
Assignees

Comments

@robinbraemer
Copy link

Description

When the Kubernetes configuration file (kubeconfig) has incorrect permissions, the vclusterctl create command fails to parse the Helm version correctly, leading to the error message "please ensure that the 'helm' binary in your PATH is valid. Currently only Helm >= v3.10.0 is supported".
The issue is that the helm version --client --template {{.Version}} command outputs the two warning messages about the insecure file permissions before the actual Helm version, and the current code in vcluster does not handle these warnings, causing the version parsing to fail.

https://github.com/loft-sh/vcluster/blob/3a488feb7aaa7b571b29ddb6dc875ae4393d4992/cmd/vclusterctl/cmd/create.go#L177C84-L177C96

vcluster create my-vcluster --namespace vtest --kubernetes-version v1.28                   
09:16:55 fatal please ensure that the "helm" binary in your PATH is valid. Currently only Helm >= v3.10.0 is supported
helm version --client --template {{.Version}}
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /Users/robin/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /Users/robin/.kube/config
v3.13

Proposed Solution

To address this issue, the vcluster code should be modified to ignore the first two warning messages when parsing the Helm version output, and only extract the actual version number.

or

chmod 600 /Users/robin/.kube/config, but it was hard to figure this out because the error message misleads to check bin paths.

@johannesfrey
Copy link
Contributor

johannesfrey commented Apr 18, 2024

Hi @robinbraemer, thx for creating this issue.
Yes, I bet the CombinedOutput made it hard to figure this out. Very unfortunate :/. But the issue should be fixed with #1699. Though, this isn't released yet.

@johannesfrey johannesfrey self-assigned this Apr 18, 2024
@johannesfrey
Copy link
Contributor

Please feel free to re-open if I missed something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants