-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Support Helm Yaml Superset in Helmfile manager #17199
Comments
These files use Go templating. Some possible approaches:
We want to avoid (4) because we currently have no CLI/shell in our extract phase |
@rarkins We're already removing any templates from yaml before parsing, so it seems like a bug to me
renovate/lib/modules/manager/helmfile/extract.ts Lines 13 to 16 in c9b21ce
|
Hi there, Get your issue fixed faster by creating a minimal reproduction. This means a repository dedicated to reproducing this issue with the minimal dependencies and config possible. Before we start working on your issue we need to know exactly what's causing the current behavior. A minimal reproduction helps us with this. To get started, please read our guide on creating a minimal reproduction. We may close the issue if you, or someone else, haven't created a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment. Good luck, The Renovate team |
Ah, then actually it seems I jumped to the wrong conclusion. So the actual file that is broken in our project has the namespace formulated like this: releases:
- name: my-release
chart: my-custom-chart
version: "1.2.3"
namespace: "{{ env "NAMESPACE" }}" which is improper quoting, but does work after templating, despite the nested double quotes. This also shows up as invalid YAML in VSCode. I patched it like this: releases:
- name: my-release
chart: my-custom-chart
version: "1.2.3"
namespace: '{{ env "NAMESPACE" }}' which looks like a proper yaml string to a yaml parser, but turns in to a different yaml string after templating. It's still improper quoting though, however VSCode does not complain about syntax. When I try proper quoting: releases:
- name: my-release
chart: my-custom-chart
version: "1.2.3"
namespace: {{ env "NAMESPACE" | quote }} VSCode again complain about invalid yaml. This led me to believe I would run into the same issue. Turns out, VSCode reads |
So actually, this works:
this works, but is improper quoting:
and this doesn't work, also improper quoting but does template fine:
Are there use cases for having |
that should work for all go templates |
🎉 This issue has been resolved in version 32.160.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
What would you like Renovate to be able to do?
It would be great if the Helmfile manager was able to parse all possible
helmfile.yaml
s, however a lot of helm/helmfile templates are not strictly valid yaml afaict, e.g.where
namespace: {{...}}
breaks the yaml parser because it looks like a broken object literal, when in reality templating will get rid of it.This either locks me out of doing templating in my helmfiles, if I want them to be renovate-friendly, or at the very least forces me to do some unsafe string sanitization:
Not quoting the template string and instead piping to the
quote
function is common practice, as it is the only way to correctly sanitize all possible strings. For a namespace I can kinda get away withnamespace: '{{ env "NAMESPACE" | quote }}'
, as namespaces are generally alphanumeric, but this is not the case for all properties, especially labels, annotations, and such.If you have any ideas on how this should be implemented, please tell us here.
Is there maybe a different parser library that can handle these things out-of-the-box? I think Helm itself (which probably faces the same issue) uses ghodss/yaml (go of course, so not helpful here, but maybe worth a look at). Or is this fundamentally unsolvable?
Is this a feature you are interested in implementing yourself?
No
The text was updated successfully, but these errors were encountered: