summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorJaideep Raghunath Rao <jaideep.r97@gmail.com>2022-01-24 11:07:39 -0500
committerGitHub <noreply@github.com>2022-01-24 17:07:39 +0100
commit89daab684fcdac4c4d3a0683fe4764a9c1abd0b4 (patch)
treee0d92ae386319625aca886b0495085cfe9e70a79 /cmd
parent527aecb345a6fdabec71ee22c1ea367c4c589850 (diff)
feat: support filtering apps by label in CLI (#368)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/main.go1
-rw-r--r--cmd/run.go3
2 files changed, 3 insertions, 1 deletions
diff --git a/cmd/main.go b/cmd/main.go
index 74009cb..3a4019d 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -40,6 +40,7 @@ type ImageUpdaterConfig struct {
MetricsPort int
RegistriesConf string
AppNamePatterns []string
+ AppLabel string
GitCommitUser string
GitCommitMail string
GitCommitMessage *template.Template
diff --git a/cmd/run.go b/cmd/run.go
index 8016c8f..581bc4b 100644
--- a/cmd/run.go
+++ b/cmd/run.go
@@ -218,6 +218,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().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")
@@ -259,7 +260,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)
+ appList, err := argocd.FilterApplicationsForUpdate(apps, cfg.AppNamePatterns, cfg.AppLabel)
if err != nil {
return result, err
}