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

fix: use field-wise templating for child matrix generators (#11661) #12287

Merged

Conversation

crenshaw-dev
Copy link
Collaborator

Fixes #11661

go-templating over a JSON string makes no sense. There will be tons of syntax conflicts.

This change switches matrix generator templating to use the same field-wise templating strategy as is used for the template field.

I've confirmed that the test fails with the same error message as in #11661 before this change.

…11661)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Feb 3, 2023

Codecov Report

Base: 47.45% // Head: 47.75% // Increases project coverage by +0.29% 🎉

Coverage data is based on head (6c13026) compared to base (e420666).
Patch coverage: 5.26% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12287      +/-   ##
==========================================
+ Coverage   47.45%   47.75%   +0.29%     
==========================================
  Files         246      246              
  Lines       41883    41933      +50     
==========================================
+ Hits        19877    20025     +148     
+ Misses      20008    19909      -99     
- Partials     1998     1999       +1     
Impacted Files Coverage Δ
applicationset/utils/utils.go 75.59% <0.00%> (-5.09%) ⬇️
...licationset/generators/generator_spec_processor.go 66.29% <50.00%> (+0.29%) ⬆️
controller/health.go 78.00% <0.00%> (-10.38%) ⬇️
server/application/terminal.go 12.67% <0.00%> (-6.81%) ⬇️
pkg/apis/application/v1alpha1/repository_types.go 69.07% <0.00%> (-2.35%) ⬇️
util/argo/argo.go 63.83% <0.00%> (-1.64%) ⬇️
server/server.go 55.64% <0.00%> (-0.87%) ⬇️
applicationset/generators/git.go 86.80% <0.00%> (-0.14%) ⬇️
reposerver/repository/repository.go 60.49% <0.00%> (-0.11%) ⬇️
... and 11 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

lsoica added a commit to lsoica/argo-cd that referenced this pull request Feb 17, 2023
Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>
Copy link
Member

@ishitasequeira ishitasequeira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR LGTM. Just added a nit for additional information while returning error.

applicationset/utils/utils.go Outdated Show resolved Hide resolved
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@crenshaw-dev
Copy link
Collaborator Author

crenshaw-dev commented Feb 24, 2023

/cherry-pick release-2.6

Copy link
Member

@ishitasequeira ishitasequeira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

@ishitasequeira
Copy link
Member

@jannfis @leoluz could you take a look as the approver?

@crenshaw-dev
Copy link
Collaborator Author

/cherry-pick release-2.5

@crenshaw-dev crenshaw-dev merged commit 98475bc into argoproj:master Mar 8, 2023
@crenshaw-dev crenshaw-dev deleted the field-wise-sub-generator-template branch March 8, 2023 18:08
gcp-cherry-pick-bot bot pushed a commit that referenced this pull request Mar 8, 2023
…12287)

* fix: use field-wise templating for child matrix generators (#11661)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* test shouldn't use go template

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* Update applicationset/utils/utils.go

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@gcp-cherry-pick-bot
Copy link

Cherry-pick failed with Merge error 98475bc43039c515de650514d272e42d7b1e4de6 into temp-cherry-pick-5573c8-release-2.5

crenshaw-dev added a commit that referenced this pull request Mar 8, 2023
…12287) (#12771)

* fix: use field-wise templating for child matrix generators (#11661)



* test shouldn't use go template



* Update applicationset/utils/utils.go



---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
crenshaw-dev added a commit that referenced this pull request Mar 8, 2023
…12287)

* fix: use field-wise templating for child matrix generators (#11661)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* test shouldn't use go template

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* Update applicationset/utils/utils.go

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@crenshaw-dev
Copy link
Collaborator Author

Manually cherry-picked onto 2.5.

crenshaw-dev added a commit that referenced this pull request Mar 22, 2023
…rom a git file (#12428) (#12490)

* fix: use field-wise templating for child matrix generators (#11661)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* test shouldn't use go template

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* feat: extend List generator with ElementsJsonBase64

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: proper field name and crd update

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: indentation

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: remove b64 encoding. Based on #12287

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: generated with codegen

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: reset some of the generated files

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: elementsyaml to cover both yaml and json

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: regenerate code

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

* Regenerate code

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

* fix: update ApplicationSet docs

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

* fix: elementsyaml to elementsYaml to be more consistent with other fields

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>
Signed-off-by: laurentiusoica <laurentiu@soica.ro>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
crenshaw-dev added a commit that referenced this pull request May 1, 2023
* fix: use field-wise templating for child matrix generators (#11661)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* test shouldn't use go template

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* feat: extend List generator with ElementsJsonBase64

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: proper field name and crd update

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: indentation

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: remove b64 encoding. Based on #12287

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: generated with codegen

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: reset some of the generated files

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: elementsyaml to cover both yaml and json

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: regenerate code

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

* Regenerate code

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

* fix: update ApplicationSet docs

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

* fix: elementsyaml to elementsYaml to be more consistent with other fields

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

* fix: preserve field order

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>
Signed-off-by: laurentiusoica <laurentiu@soica.ro>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
yyzxw pushed a commit to yyzxw/argo-cd that referenced this pull request Aug 9, 2023
…11661) (argoproj#12287)

* fix: use field-wise templating for child matrix generators (argoproj#11661)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* test shouldn't use go template

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* Update applicationset/utils/utils.go

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
yyzxw pushed a commit to yyzxw/argo-cd that referenced this pull request Aug 9, 2023
…rom a git file (argoproj#12428) (argoproj#12490)

* fix: use field-wise templating for child matrix generators (argoproj#11661)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* test shouldn't use go template

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* feat: extend List generator with ElementsJsonBase64

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: proper field name and crd update

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: indentation

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: remove b64 encoding. Based on argoproj#12287

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: generated with codegen

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: reset some of the generated files

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: elementsyaml to cover both yaml and json

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: regenerate code

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

* Regenerate code

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

* fix: update ApplicationSet docs

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

* fix: elementsyaml to elementsYaml to be more consistent with other fields

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>
Signed-off-by: laurentiusoica <laurentiu@soica.ro>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
yyzxw pushed a commit to yyzxw/argo-cd that referenced this pull request Aug 9, 2023
* fix: use field-wise templating for child matrix generators (argoproj#11661)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* test shouldn't use go template

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* feat: extend List generator with ElementsJsonBase64

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: proper field name and crd update

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: indentation

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: remove b64 encoding. Based on argoproj#12287

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: generated with codegen

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: reset some of the generated files

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: elementsyaml to cover both yaml and json

Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>

* fix: regenerate code

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

* Regenerate code

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

* fix: update ApplicationSet docs

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

* fix: elementsyaml to elementsYaml to be more consistent with other fields

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

* fix: preserve field order

Signed-off-by: laurentiusoica <laurentiu@soica.ro>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Laurentiu Soica <laurentiu@soica.ro>
Signed-off-by: laurentiusoica <laurentiu@soica.ro>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ApplicationSet] Support Go Templating in spec.generators
3 participants