diff options
| author | jannfis <jann@mistrust.net> | 2020-08-19 09:41:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-19 09:41:14 +0200 |
| commit | e848d6f558d87e2150767be87f4cf0cb18a28954 (patch) | |
| tree | 7d3921b9d7ff6b843057cd0a935189157d7accbd /cmd | |
| parent | 1fb6cbab5e5c3bb8dfee71f3cb48caa2e802d751 (diff) | |
feat: Allow filtering by application name (#66)
* feat: Allow filtering by application name
* include allowed word otherapp
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/main.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/main.go b/cmd/main.go index b0d2ab9..ff951c4 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -41,6 +41,7 @@ type ImageUpdaterConfig struct { MaxConcurrency int HealthPort int RegistriesConf string + AppNamePatterns []string } // Main loop for argocd-image-controller @@ -66,7 +67,7 @@ func runImageUpdater(cfg *ImageUpdaterConfig) (argocd.ImageUpdaterResult, error) // Get the list of applications that are allowed for updates, that is, those // applications which have correct annotation. - appList, err := argocd.FilterApplicationsForUpdate(apps) + appList, err := argocd.FilterApplicationsForUpdate(apps, cfg.AppNamePatterns) if err != nil { return result, err } @@ -305,6 +306,7 @@ func newRunCommand() *cobra.Command { runCmd.Flags().BoolVar(&disableKubernetes, "disable-kubernetes", false, "do not create and use a Kubernetes client") runCmd.Flags().IntVar(&cfg.MaxConcurrency, "max-concurrency", 10, "maximum number of update threads to run concurrently") runCmd.Flags().StringVar(&cfg.ArgocdNamespace, "argocd-namespace", "argocd", "namespace where ArgoCD runs in") + runCmd.Flags().StringSliceVar(&cfg.AppNamePatterns, "match-application-name", nil, "patterns to match application name against") return runCmd } |
