Skip to content

feat: helmfile.yaml layering enhancements#587

Merged
mumoshu merged 2 commits into
masterfrom
layering-enhancements
May 14, 2019
Merged

feat: helmfile.yaml layering enhancements#587
mumoshu merged 2 commits into
masterfrom
layering-enhancements

Conversation

@mumoshu

@mumoshu mumoshu commented May 13, 2019

Copy link
Copy Markdown
Collaborator

The current Layering system didn't work as documented, as it relies on helmfile to template each "part" of your helmfile.yaml THEN merge them one by one.

The reality was that helmfile template all the parts of your helmfile.yaml at once, and then merge those YAML documents. In #388 (comment), @sruon was making a GREAT point that we may need to change helmfile to render templates earlier - that is to evaluate a template per each helmfile.yaml part separated by ---. Sorry I missed my expertise to follow your great idea last year @sruon 😭

Anyways, this, in combination with the wrong documentation, has made so many people confused. To finally overcome this situation, here's a fairly large PR that introduces the 2 enhancements:

  • bases: for easier layering without go template expressions, especially {{ readFunc "path/to/file" }}s. This is the first commit of this PR.
  • helmfile.yaml is splited by the separator --- at first. Each part is then rendered as a go template(double-render applies as before). Finally, All the results are merged in the order of occurence. I assume this as an enhanced version of @sruon's work. This is the second commit of this PR.

Resolves #388
Resolve #584
Resolves #585 (HELMFILE_EXPERIMENTA=true -f helmfile.yaml helmfile disables the whole-file templating, treating the helmfile.yaml as a regular YAML file as the file ext. denotes. Use helmfile.yaml.gotmpl or helmfile.gotmpl to enable)
Fixes #568 (Use bases or readFile rather than not importing implicitly with helmfile.d

mumoshu added 2 commits May 13, 2019 21:48
This adds the new configuration key `baeses` to your helmfile.yaml files, so that you can layer them without the `readFile` template function, which was a bit unintuitive.

Please see #388 (comment) for more context
This splits your helmfile.yaml by the YAML document separator "---" before evaluating go template expressions as outlined in #388 (comment)

@davidovich davidovich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow. LGTM

@orbiran88

Copy link
Copy Markdown
Contributor

Awesome!

@mumoshu

mumoshu commented May 14, 2019

Copy link
Copy Markdown
Collaborator Author

Thanks for reviewing!

@mumoshu mumoshu merged commit 255d920 into master May 14, 2019
@mumoshu mumoshu deleted the layering-enhancements branch May 14, 2019 00:48
@bitsofinfo

Copy link
Copy Markdown
Contributor

trying to use bases: as documented, in 0.63, and completely does not work. Is this PR above to fix it? is there a document update to come as well?

@mumoshu

mumoshu commented May 17, 2019

Copy link
Copy Markdown
Collaborator Author

@bitsofinfo This PR includes the documentation update as well. Do you see any error messages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants