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

Rename source ref to name and make it a merge key #15975

Open
crenshaw-dev opened this issue Oct 14, 2023 · 0 comments
Open

Rename source ref to name and make it a merge key #15975

crenshaw-dev opened this issue Oct 14, 2023 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@crenshaw-dev
Copy link
Member

Summary

kind: Application
spec:
  sources:
  - name: my-chart # make "name" a required field 
    repoUrl: <helm chart>
    valueFiles:
    - $values/values-prod.yaml
  - name: values # call it "name" instead of "ref"
    repoUrl: <git repo>

Motivation

Patching lists is difficult. It's easier with strategic merge patching when you define a merge key for the list items.

Adding this merge key would let users patch Applications using Kustomize or kubectl in a more precise and intuitive way.

It would also allow ignoreApplicationDifferences in ApplicationSets to avoid strange behavior when trying to ignore individual fields in list items.

Proposal

  1. Rename ref to name. Why reuse ref? It already serves the similar purpose of uniquely identifying a source. Why call it name? Because that's more standard/expected for merge keys on lists.
  2. Make the field required, because that's how merge keys work.

We shouldn't do this until Argo 3.0, because 1) renaming a field is a breaking API change, and 2) requiring the previously-optional field is another breaking API change.

Argo 3.0 should provide a mechanism to automatically rename the field on conversion, but it'll still have to throw an error and ask the user to name unnamed sources.

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
Development

No branches or pull requests

1 participant