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 lint breaks when local charts are referenced from helmfile.d/ #252

Closed
davidovich opened this issue Aug 30, 2018 · 2 comments
Closed
Labels

Comments

@davidovich
Copy link
Contributor

Problem

When a local chart is referenced in the state file, helmfile lint tries to fetch the chart anyway.

This can be observed by using this simple helmfile (local-chart-helmfile.yaml):

releases:
- name: my-release
  namespace: default
  chart: ../local-charts/my-local-chart # this 

Here is the file layout to reproduce the problem:

root
  | local-charts
  `--| my-local-chart
  | helmfile.d
  `--| local-chart-hemlfile.yaml

Other helmfile operations seem to work as expected (I tested sync).

Analysis

After some investigation, this is probably related to a wrong working directory, for the LintRelease() function as isLocalChart() (a simple os.Stat() with no root dir decoration) called from LintReleases() returns false for a relative path.

If I change the chart: path in local-chart-helmfile.yaml to be rooted at the working directory, linting completes without error. But this is not a viable solution because other helmfile operations (sync) treat relative paths relative to the helmfile.yaml (or helmfile.d/).

If I change the working directory to helmfile.d/ and issue helmfile -f . lint this also completes without error, which is a temporary workaround.

Note that helmfile -f helmfile.d/ sync works as intended as the chart can be reached relative to manifest file, as stated in the README documentation.

Related issue #246

I think a concept of root dir as determined by the -f argument, and propagated to every command would solve this problem.

@mumoshu mumoshu added the bug label Aug 30, 2018
@mumoshu
Copy link
Collaborator

mumoshu commented Aug 30, 2018

@davidovich Thanks for the detailed report!

Certainly I should have confused very much at the time of writing #246. Yes, charts should be reached relative to where manifest files are.

mumoshu added a commit to mumoshu/helmfile that referenced this issue Aug 30, 2018
`helmfile lint` works with relative chart reference (roboll#252)
The tempalte function `readFile` accepts the path relative to helmfile.yaml

Resolves roboll#246
Fixes roboll#252
mumoshu added a commit that referenced this issue Aug 30, 2018
`helmfile lint` works with relative chart reference (#252)
The tempalte function `readFile` accepts the path relative to helmfile.yaml

Resolves #246
Fixes #252
@davidovich
Copy link
Contributor Author

Thank you @mumoshu !, that was fast :-)

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