You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new ApplicationSet templatePatch introduced in #14893 does not merge lists from template. It will override a list field entirely. An example is when using sources to list multiple sources. Consider the following example which produces the error
InvalidSpecError: spec.source.repoURL and either source.path, source.chart, or source.ref are required for source...
Putting all sources in templatePatch does work, but is not ideal as it could be a very large string that doesn't work as nicely in IDEs as an object would. Here is the equivalent example that works:
The sources in the templatePatch will be deep merged with the sources in template, using repoURL or perhaps ref as a merge key.
That might not be feasible because while repoURL is required, it is not necessarily unique. ref is unique but not required. Perhaps ref could be required in the case where a source merge is desired.
This behaviour would be similar to how a Kustomize strategic merge patch patches Container fields within a Pod spec, using the Container name as a unique merge key.
If not then at least additional sources in templatePatch could be appended to the existing list of sources in template?
Yeah templatePatch does use strategicMergePatch under the hood, but it's not actually super helpful since the sources array doesn't specify merge keys. I do think that ref is a good candidate to be a merge key, but that's maybe a bigger API change than we have an appetite for without bumping the Application apiVersion.
Checklist:
argocd version
.Describe the bug
The new ApplicationSet
templatePatch
introduced in #14893 does not merge lists fromtemplate
. It will override a list field entirely. An example is when usingsources
to list multiple sources. Consider the following example which produces the errorTo Reproduce
Putting all sources in
templatePatch
does work, but is not ideal as it could be a very large string that doesn't work as nicely in IDEs as an object would. Here is the equivalent example that works:Expected behavior
The
sources
in thetemplatePatch
will be deep merged with thesources
intemplate
, usingrepoURL
or perhapsref
as a merge key.That might not be feasible because while
repoURL
is required, it is not necessarily unique.ref
is unique but not required. Perhapsref
could be required in the case where a source merge is desired.This behaviour would be similar to how a Kustomize strategic merge patch patches Container fields within a Pod spec, using the Container
name
as a unique merge key.If not then at least additional sources in
templatePatch
could be appended to the existing list of sources intemplate
?Version
The text was updated successfully, but these errors were encountered: