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

repository.yaml not found if permissions on $KUBECONFIG are bad #329

Closed
kkalmbach opened this issue Nov 17, 2023 · 3 comments
Closed

repository.yaml not found if permissions on $KUBECONFIG are bad #329

kkalmbach opened this issue Nov 17, 2023 · 3 comments
Labels

Comments

@kkalmbach
Copy link

kkalmbach commented Nov 17, 2023

I am running helm on an ubuntu box and am getting an error of unable to find the repositories.yaml file if the permissions on KUBECONFIG are "bad"

helm s3 push  --force  ./mychart-1.0.0.tgz  my-bucket
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: XXXXXXX
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: XXXXXXX
Error: load repo file: stat /home/XXXX/.helm/repository/repositories.yaml: no such file or directory
Error: plugin "s3" exited with error

But if I fix the permissions warnings on kubeconfig, then it works.

chmod og-rw $KUBECONFIG
helm s3 push  --force  ./mychart-1.0.0.tgz  my-bucket
Successfully uploaded the chart to the repository.

FWIW, the repositories.yaml file is in ~/.config/helm/repositories.yaml

@hypnoglow
Copy link
Owner

  • Are you using Helm v2?

    The path of the repositories.yaml file suggests that, as it should be ~/.config/helm/repositories.yaml on Linux in Helm v3.

  • What is your helm-s3 plugin version?

  • Also, why do you have insecure permissions on KUBECONFIG in the first place?

@kkalmbach
Copy link
Author

We are using helm3 and the newest version of the plugin.

~$ helm version
version.BuildInfo{Version:"v3.13.1", GitCommit:"3547a4b5bf5edb5478ce352e18858d8a552a4110", GitTreeState:"clean", GoVersion:"go1.21.3"}
~$ helm s3 version
0.15.1

As far as the permissions go, there was nothing sensitive in the files (no certs/passwords/etc), so it wasn't super important.
We have changed the permission on the config file and everything is working, so this is not a blocker for us.

@hypnoglow
Copy link
Owner

I suppose that the warning output somehow mingles helm version detection and it is detected as v2.

In such cases helm version may be forced with HELM_S3_MODE=v3 env var.

Further, I think the plugin should stop falling back to v2 and fall back to v3 instead, as v2 is unsupported for a long time already. I made a PR #334

I'm going to close this, anyway, thanks for reporting!

@hypnoglow hypnoglow closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2023
hypnoglow added a commit that referenced this issue Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants