applicationset icon indicating copy to clipboard operation
applicationset copied to clipboard

Non-string template variables (alt: template overrides from git)

Open dominykas opened this issue 2 years ago • 4 comments

I have a bunch of applications loaded from git.

Sometimes we need to stop syncing per application.

It seems there is currently no way to achieve this? If I got it right:

  • You cannot set syncPolicy.automated.selfHeal to '{{ autoSync }}' as selfHeal needs to be a boolean. Having only strings as variables is quite a heavy limitation
    • Another place where I have this issue is valueFiles for Helm, which are also app dependent, but this can be worked around by providing a single concatenated string as the list item
  • You cannot load generated templates when using git generator?

dominykas avatar Jul 06 '21 14:07 dominykas

Hi @dominykas,

Re: only strings as variable, let me check that out, agreed, let me check that out.

Re: loading generated templates, I am guessing you mean something like this: https://github.com/argoproj-labs/applicationset/issues/168#issue-840093112 (eg the ability to provide YAML/JSON within a Git file generator's configuration file, and have that substituted into the ApplicationSet template?)

jgwest avatar Jul 12 '21 14:07 jgwest

have that substituted into the ApplicationSet template

Looking at the example from the thread, yes - it could work for the use cases I'm thinking of.

Thanks!

dominykas avatar Jul 13 '21 07:07 dominykas

We are investigating using ApplicationSets to provision helm applications. Helm supports list templating and we use this to generate n amount of resources from a helm values list. Since ApplicationSets currently only supports strings we cannot use ApplicationSets to provision our applications.

Since json/yaml is used as the substitution configuration it makes sense to me that ApplicationSets should support the full typeset of json/yaml. Otherwise json/yaml does not make sense as a config file type.

The docs also currently do not make it clear that only strings (or nested objects, as long as eventually the value is a string) are supported so it is easy to make the mistake that since the config file is json, the assumption can be made that basic valid json would work (I would argue json lists are a pretty basic json feature).

rouke-broersma avatar Jul 22 '21 08:07 rouke-broersma

@rouke-broersma Very well written as you say exactly my experience with this;

First being surprised that a json list didn't work and then trying to understand what kind of limitation the templating part has (documentation doesn't specify, and only have very basic examples).

parberge avatar Dec 15 '21 09:12 parberge