diff options
| author | Jaideep Raghunath Rao <jaideep.r97@gmail.com> | 2022-01-24 11:07:39 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-24 17:07:39 +0100 |
| commit | 89daab684fcdac4c4d3a0683fe4764a9c1abd0b4 (patch) | |
| tree | e0d92ae386319625aca886b0495085cfe9e70a79 /cmd | |
| parent | 527aecb345a6fdabec71ee22c1ea367c4c589850 (diff) | |
feat: support filtering apps by label in CLI (#368)
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/main.go | 1 | ||||
| -rw-r--r-- | cmd/run.go | 3 |
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 @@ -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 } |
