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

feat: Support app-wide update-strategy annotations #338

Merged

Conversation

janpieper
Copy link
Contributor

@janpieper janpieper commented Jan 10, 2022

Problem

Currently, you're forced to specify e.g the update strategy per image, although it might be the same for all:

# ...
metadata:
  annotations:
    argocd-image-updater.argoproj.io/image-list: frontend=my-fancy-frontend, backend=my-fancy-backend
    argocd-image-updater.argoproj.io/frontend.update-strategy: name
    argocd-image-updater.argoproj.io/backend.update-strategy: name
# ...

Proposal

This PR adds four new annotations to allow you to specify update-strategy related options for all images in a ArgoCD application.

  • argocd-image-updater.argoproj.io/allow-tags
  • argocd-image-updater.argoproj.io/ignore-tags
  • argocd-image-updater.argoproj.io/force-update
  • argocd-image-updater.argoproj.io/update-strategy
  • argocd-image-updater.argoproj.io/pull-secret

(Note: I am using the update-strategy annotations for all of my following examples, but the handling is the same of all of them)

With these new annotations you can use only one annotations to specify it for all of them:

# ...
metadata:
  annotations:
    argocd-image-updater.argoproj.io/image-list: frontend=my-fancy-frontend, backend=my-fancy-backend
    argocd-image-updater.argoproj.io/update-strategy: name
# ...

You can still override the app-wide configuration by adding the image-based annotation:

# ...
metadata:
  annotations:
    argocd-image-updater.argoproj.io/image-list: frontend=my-fancy-frontend, backend=my-fancy-backend
    argocd-image-updater.argoproj.io/update-strategy: name
    argocd-image-updater.argoproj.io/frontend.update-strategy: semver
# ...

Order

When configuring these annotations, that's the order of how the options get evaluated:

# Annotation Description
1 argocd-image-updater.argoproj.io/<alias>.<option> for specific image
2 argocd-image-updater.argoproj.io/update-strategy for all images (app-wide)
3 -/- default

Additional changes

  • Renamed SecretListAnnotation to PullSecretAnnotation
  • Renamed ApplicationWideSecretListAnnotation to ApplicationWidePullSecretAnnotation

@jannfis
Copy link
Contributor

jannfis commented Jan 25, 2022

Hi @janpieper - will you have time to finish this PR?

I'm asking because I really would like to include this feature with v0.12.0, which is most likely going to be released early February.

@janpieper
Copy link
Contributor Author

Will try to get this done by the end of the week 😉 Don't know whether I find some time before the weekend, but let's see 😉

@janpieper janpieper force-pushed the app-wide-update-strategy-annotations branch 2 times, most recently from 13e0614 to 1b95356 Compare January 29, 2022 12:52
@janpieper janpieper force-pushed the app-wide-update-strategy-annotations branch from 1b95356 to 7a5a57f Compare January 29, 2022 13:09
@janpieper
Copy link
Contributor Author

@jannfis I think (hope?) the changes should be complete for the proposed new feature, so I mark this PR ready for review 😉

I did not include all your changes from your closed PR, to not blow up this PR with "unrelated" changes.

@janpieper janpieper marked this pull request as ready for review January 29, 2022 13:25
Copy link
Contributor

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this contribution, @janpieper! Much appreciated.

Change LGTM.

@jannfis jannfis changed the title Support app-wide update-strategy annotations feat: Support app-wide update-strategy annotations Jan 29, 2022
@jannfis jannfis merged commit e46a206 into argoproj-labs:master Jan 29, 2022
@janpieper janpieper deleted the app-wide-update-strategy-annotations branch June 5, 2024 06:54
sribiere-jellysmack pushed a commit to sribiere-jellysmack/argocd-image-updater that referenced this pull request Aug 13, 2024
* feat: support app-wide update-strategy annotations

* refactor: rename constants for pull-secret annotations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants