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

Allow values to be added & interpolated in Git and SCM generators #10751

Closed
girstenbrei opened this issue Sep 30, 2022 · 0 comments · Fixed by #10754
Closed

Allow values to be added & interpolated in Git and SCM generators #10751

girstenbrei opened this issue Sep 30, 2022 · 0 comments · Fixed by #10754
Labels
enhancement New feature or request

Comments

@girstenbrei
Copy link
Contributor

Summary

After reading #9978 , I figured it would be nice to extend the functionality to set and interpolate values from the cluster ApplicationSet generator to other generators as well.

Motivation

I have multiple clusters and multiple applications configured in their own repositories. I want these applications to be able to deploy themselves to clusters by having a dedicated branch per cluster.

One option is to use the cluster generator to discover configured clusters. Assuming those have a metadata.labels.location set, the SCM generator could discover those branches.

To combine those two, I could then have a values.selector label. The cluster generator sets values.selector = metadata.labels.location while the SCM generator does values.selector = branch. This then can be used by the merge generator to combine settings for each.

Proposal

Re-use the already existing interpolation from the cluster generator and do the same for other interesting generators.

@girstenbrei girstenbrei added the enhancement New feature or request label Sep 30, 2022
crenshaw-dev added a commit that referenced this issue May 29, 2023
… Git and SCM generators (#10751) (#10754)

* Factor out value interpolation

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Pass on useGoTemplate directly

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Add values for git directories & files

Interpolate values in git files generator

Document git generator value interpolation

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Consolidate value interpolation tests

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Enable multiple testcases for SCM provider test

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Add values to SCM provider & document

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Add merge generator example

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Codegen - run to autogen docs & code

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Re-run codegen

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Re-do codegen

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Note about unsupported nested merge

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

---------

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Christoph Girstenbrei <christoph.girstenbrei@retarus.de>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
yyzxw pushed a commit to yyzxw/argo-cd that referenced this issue Aug 9, 2023
… Git and SCM generators (argoproj#10751) (argoproj#10754)

* Factor out value interpolation

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Pass on useGoTemplate directly

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Add values for git directories & files

Interpolate values in git files generator

Document git generator value interpolation

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Consolidate value interpolation tests

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Enable multiple testcases for SCM provider test

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Add values to SCM provider & document

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Add merge generator example

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Codegen - run to autogen docs & code

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Re-run codegen

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Re-do codegen

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Note about unsupported nested merge

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

---------

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Christoph Girstenbrei <christoph.girstenbrei@retarus.de>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
tesla59 pushed a commit to tesla59/argo-cd that referenced this issue Dec 16, 2023
… Git and SCM generators (argoproj#10751) (argoproj#10754)

* Factor out value interpolation

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Pass on useGoTemplate directly

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Add values for git directories & files

Interpolate values in git files generator

Document git generator value interpolation

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Consolidate value interpolation tests

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Enable multiple testcases for SCM provider test

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Add values to SCM provider & document

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Add merge generator example

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Codegen - run to autogen docs & code

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Re-run codegen

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Re-do codegen

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

* Note about unsupported nested merge

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>

---------

Signed-off-by: Christoph Girstenbrei <Christoph.Girstenbrei@gmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Christoph Girstenbrei <christoph.girstenbrei@retarus.de>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
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
1 participant