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

Helmfile resolves relative paths incorrectly if PWD is a softlink #1013

Closed
reegnz opened this issue Sep 12, 2023 · 3 comments · Fixed by #1020
Closed

Helmfile resolves relative paths incorrectly if PWD is a softlink #1013

reegnz opened this issue Sep 12, 2023 · 3 comments · Fixed by #1020

Comments

@reegnz
Copy link
Contributor

reegnz commented Sep 12, 2023

Operating system

MacOS Ventura 13.5.2

Helmfile Version

0.157.0

Helm Version

3.12.3

Bug description

When using relative paths (eg. path: ../../helmfile.yaml) in helmfile.yaml, the relative path should always be resolved to the absolute path, with symlinks being resolved. Otherwise the behaviour of helmfile breaks:

  • helmfile behaves differently if the directory it is softlinked and invoked when cd-ing into the softlink.

When you ignore softlinks (eg. resolve them always), the problem just goes away and has a reasonable default behaviour: always picking up relative paths from the real paths, not softlinked ones.

Example helmfile.yaml

See example repo.

Error message you've seen (if any)

❯ helmfile template
in ./helmfile.yaml: in .helmfiles[0]: in ../../helmfile.yaml: open helmfile.yaml: no such file or directory

Steps to reproduce

https://github.com/reegnz/helmfile-bug

Working Helmfile Version

never worked correctly

Relevant discussion

No response

@reegnz
Copy link
Contributor Author

reegnz commented Sep 12, 2023

I'm preparing a PR to fix this.

@reegnz
Copy link
Contributor Author

reegnz commented Sep 12, 2023

BTW tools like direnv deal with this problem really gracefully already.

@yxxhero
Copy link
Member

yxxhero commented Sep 13, 2023

@reegnz good catch.

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

Successfully merging a pull request may close this issue.

2 participants