hypnoglow / helm-s3

⎈ Helm plugin that adds support for AWS S3 as a chart repository.
https://helm-s3.hypnoglow.io
MIT License
567 stars 159 forks source link

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

Closed kkalmbach closed 12 months ago

kkalmbach commented 1 year ago

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 commented 12 months ago
kkalmbach commented 12 months ago

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 commented 12 months ago

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!