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

Add various go template function from helm #1458

Merged
merged 6 commits into from
Aug 10, 2023
Merged

Conversation

olblak
Copy link
Member

@olblak olblak commented Aug 10, 2023

Requires

This pullrequest adds the following go template function

  • toYaml
  • fromYaml
  • fromYamlArray

The goal is to provide more templating possibilities when using .tpl files such as

sources:
  default:
    {{ .sources.default | toYaml }}

targets:
    default:
      kind: file
      spec:
        file: "/tmp/example.yaml"

Fix #961

Test

To test this pull request, you can run the following commands:

cd pkg/core/config/
go test

Additional Information

Tradeoff

More advanced templating means more complex pipeline which are obviously harder to maintain on long term :(
This also means we lose schema validation for manifest which are not YAML compliant...

Potential improvement

Offering another configuration syntax like HCL or Cuelang for more advanced needs

Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added this to the 0.57.0 milestone Aug 10, 2023
@olblak olblak added the enhancement New feature or request label Aug 10, 2023
@olblak olblak merged commit 39401d0 into updatecli:main Aug 10, 2023
6 checks passed
@olblak olblak deleted the issue/961/2 branch August 12, 2023 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: multiple/reusable configuration files
1 participant