summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorjnovick <joshua.novick@hunters.ai>2024-08-14 04:18:58 +0300
committerGitHub <noreply@github.com>2024-08-13 21:18:58 -0400
commit0ad5b94ff483bd2045e7adb3f54b1ca4c700d3da (patch)
tree831f89b990e246d8135553641417ce3434fbf6e9 /cmd
parent65698c5ebfb97784c02096e256f1a2f6b0d5304e (diff)
feat!: Filter labels on the server instead of client to allow more label filtering options (#832)
Signed-off-by: Joshua Novick <joshua.novick@hunters.ai>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/run.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/run.go b/cmd/run.go
index 751c29c..06030d2 100644
--- a/cmd/run.go
+++ b/cmd/run.go
@@ -236,7 +236,7 @@ func newRunCommand() *cobra.Command {
runCmd.Flags().IntVar(&cfg.MaxConcurrency, "max-concurrency", 10, "maximum number of update threads to run concurrently")
runCmd.Flags().StringVar(&cfg.ArgocdNamespace, "argocd-namespace", "", "namespace where ArgoCD runs in (current namespace by default)")
runCmd.Flags().StringSliceVar(&cfg.AppNamePatterns, "match-application-name", nil, "patterns to match application name against")
- runCmd.Flags().StringVar(&cfg.AppLabel, "match-application-label", "", "label to match application labels against")
+ runCmd.Flags().StringVar(&cfg.AppLabel, "match-application-label", "", "label selector to match application labels against")
runCmd.Flags().BoolVar(&warmUpCache, "warmup-cache", true, "whether to perform a cache warm-up on startup")
runCmd.Flags().StringVar(&cfg.GitCommitUser, "git-commit-user", env.GetStringVal("GIT_COMMIT_USER", "argocd-image-updater"), "Username to use for Git commits")
runCmd.Flags().StringVar(&cfg.GitCommitMail, "git-commit-email", env.GetStringVal("GIT_COMMIT_EMAIL", "noreply@argoproj.io"), "E-Mail address to use for Git commits")
@@ -267,7 +267,7 @@ func runImageUpdater(cfg *ImageUpdaterConfig, warmUp bool) (argocd.ImageUpdaterR
}
cfg.ArgoClient = argoClient
- apps, err := cfg.ArgoClient.ListApplications()
+ apps, err := cfg.ArgoClient.ListApplications(cfg.AppLabel)
if err != nil {
log.WithContext().
AddField("argocd_server", cfg.ClientOpts.ServerAddr).
@@ -281,7 +281,7 @@ func runImageUpdater(cfg *ImageUpdaterConfig, warmUp bool) (argocd.ImageUpdaterR
// Get the list of applications that are allowed for updates, that is, those
// applications which have correct annotation.
- appList, err := argocd.FilterApplicationsForUpdate(apps, cfg.AppNamePatterns, cfg.AppLabel)
+ appList, err := argocd.FilterApplicationsForUpdate(apps, cfg.AppNamePatterns)
if err != nil {
return result, err
}