Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Git files generator: add support for YAML files #106

Closed
jgwest opened this issue Jan 26, 2021 · 4 comments · Fixed by #211
Closed

Git files generator: add support for YAML files #106

jgwest opened this issue Jan 26, 2021 · 4 comments · Fixed by #211
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jgwest
Copy link
Member

jgwest commented Jan 26, 2021

The initial Git files generator support has merged, but it currently only supports processing JSON files from a git repository.

The ApplicationSet design design doc notes that "referenced files would contain a json/yaml list of arbitrary structured objects", and thus I have opened this issue to track adding support for YAML files within git.

If/when this is implemented, search through the (markdown) docs for references to JSON, and update them to JSON/YAML.

@jgwest jgwest added the enhancement New feature or request label Jan 26, 2021
@marcozov
Copy link

Sorry if this is not relevant, but: should this also support a way to pass parameters/values from this file, as a unique YAML block?
This is the use case that I have in mind: https://argocd-applicationset.readthedocs.io/en/stable/Use-Cases/#use-case-self-service-of-argo-cd-applications-on-multitenant-clusters . What if I, as administrator, want to provide users the possibility of generating N applications in a specific project (that I fix, just like it's shown in the example) with their own values?

@andrejpetras
Copy link

Hi, I created PoC for my case.

https://github.com/lorislab/applicationset/tree/yaml

I put a short description in the README file.
The generator in the ApplicationSet is the git generator which will check if file ends with .yaml
Before the template is generated from the yaml file it will be merged with global.yml file if exists.
Template parameters are [root key] = string value of the merged yaml.

Source code: https://github.com/lorislab/applicationset/blob/yaml/pkg/generators/git.go#L221

@jgwest
Copy link
Member Author

jgwest commented Apr 19, 2021

As mentioned on 173, I think this issue should first stick to implementing the YAML parsing functionality consistent with the JSON parsing functionality, before we add new changes on top as proposed in the lorislab yaml branch, eg per-directory values (the global.yml), changes to how file values are flattened, and addition of new path and path.basename parameters.

@teejaded
Copy link
Contributor

teejaded commented Apr 22, 2021

JSON is a subset of YAML. Pretty sure we can just switch to a YAML parser. This passes the go-tests.

#211

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants