Skip to content

Commit 375346e

Browse files
authored
chore(crd): add deprecation warnings for CRD branch removed functionality (#1223)
Signed-off-by: Denis Karpelevich <[email protected]>
1 parent cc9f71b commit 375346e

File tree

8 files changed

+108
-18
lines changed

8 files changed

+108
-18
lines changed

cmd/run.go

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -309,12 +309,16 @@ func newRunCommand() *cobra.Command {
309309
},
310310
}
311311

312-
runCmd.Flags().StringVar(&cfg.ApplicationsAPIKind, "applications-api", env.GetStringVal("APPLICATIONS_API", applicationsAPIKindK8S), "API kind that is used to manage Argo CD applications ('kubernetes' or 'argocd')")
313-
runCmd.Flags().StringVar(&cfg.ClientOpts.ServerAddr, "argocd-server-addr", env.GetStringVal("ARGOCD_SERVER", ""), "address of ArgoCD API server")
314-
runCmd.Flags().BoolVar(&cfg.ClientOpts.GRPCWeb, "argocd-grpc-web", env.GetBoolVal("ARGOCD_GRPC_WEB", false), "use grpc-web for connection to ArgoCD")
315-
runCmd.Flags().BoolVar(&cfg.ClientOpts.Insecure, "argocd-insecure", env.GetBoolVal("ARGOCD_INSECURE", false), "(INSECURE) ignore invalid TLS certs for ArgoCD server")
316-
runCmd.Flags().BoolVar(&cfg.ClientOpts.Plaintext, "argocd-plaintext", env.GetBoolVal("ARGOCD_PLAINTEXT", false), "(INSECURE) connect without TLS to ArgoCD server")
317-
runCmd.Flags().StringVar(&cfg.ClientOpts.AuthToken, "argocd-auth-token", "", "use token for authenticating to ArgoCD (unsafe - consider setting ARGOCD_TOKEN env var instead)")
312+
// DEPRECATED: These flags have been removed in the CRD branch and will be deprecated and removed in a future release.
313+
// The CRD branch introduces a new architecture that eliminates the need for these native ArgoCD client configuration flags.
314+
runCmd.Flags().StringVar(&cfg.ApplicationsAPIKind, "applications-api", env.GetStringVal("APPLICATIONS_API", applicationsAPIKindK8S), "API kind that is used to manage Argo CD applications ('kubernetes' or 'argocd'). DEPRECATED: this flag will be removed in a future version.")
315+
runCmd.Flags().StringVar(&cfg.ClientOpts.ServerAddr, "argocd-server-addr", env.GetStringVal("ARGOCD_SERVER", ""), "address of ArgoCD API server. DEPRECATED: this flag will be removed in a future version.")
316+
runCmd.Flags().BoolVar(&cfg.ClientOpts.GRPCWeb, "argocd-grpc-web", env.GetBoolVal("ARGOCD_GRPC_WEB", false), "use grpc-web for connection to ArgoCD. DEPRECATED: this flag will be removed in a future version.")
317+
runCmd.Flags().BoolVar(&cfg.ClientOpts.Insecure, "argocd-insecure", env.GetBoolVal("ARGOCD_INSECURE", false), "(INSECURE) ignore invalid TLS certs for ArgoCD server. DEPRECATED: this flag will be removed in a future version.")
318+
runCmd.Flags().BoolVar(&cfg.ClientOpts.Plaintext, "argocd-plaintext", env.GetBoolVal("ARGOCD_PLAINTEXT", false), "(INSECURE) connect without TLS to ArgoCD server. DEPRECATED: this flag will be removed in a future version.")
319+
runCmd.Flags().StringVar(&cfg.ClientOpts.AuthToken, "argocd-auth-token", "", "use token for authenticating to ArgoCD (unsafe - consider setting ARGOCD_TOKEN env var instead). DEPRECATED: this flag will be removed in a future version.")
320+
runCmd.Flags().BoolVar(&disableKubernetes, "disable-kubernetes", false, "do not create and use a Kubernetes client. DEPRECATED: this flag will be removed in a future version.")
321+
318322
runCmd.Flags().BoolVar(&cfg.DryRun, "dry-run", false, "run in dry-run mode. If set to true, do not perform any changes")
319323
runCmd.Flags().DurationVar(&cfg.CheckInterval, "interval", env.GetDurationVal("IMAGE_UPDATER_INTERVAL", 2*time.Minute), "interval for how often to check for updates")
320324
runCmd.Flags().StringVar(&cfg.LogLevel, "loglevel", env.GetStringVal("IMAGE_UPDATER_LOGLEVEL", "info"), "set the loglevel to one of trace|debug|info|warn|error")
@@ -323,12 +327,15 @@ func newRunCommand() *cobra.Command {
323327
runCmd.Flags().IntVar(&cfg.MetricsPort, "metrics-port", 8081, "port to start the metrics server on, 0 to disable")
324328
runCmd.Flags().BoolVar(&once, "once", false, "run only once, same as specifying --interval=0 and --health-port=0")
325329
runCmd.Flags().StringVar(&cfg.RegistriesConf, "registries-conf-path", defaultRegistriesConfPath, "path to registries configuration file")
326-
runCmd.Flags().BoolVar(&disableKubernetes, "disable-kubernetes", false, "do not create and use a Kubernetes client")
327330
runCmd.Flags().IntVar(&cfg.MaxConcurrency, "max-concurrency", 10, "maximum number of update threads to run concurrently")
328331
runCmd.Flags().StringVar(&cfg.ArgocdNamespace, "argocd-namespace", "", "namespace where ArgoCD runs in (current namespace by default)")
329332
runCmd.Flags().StringVar(&cfg.AppNamespace, "application-namespace", v1.NamespaceAll, "namespace where Argo Image Updater will manage applications (all namespaces by default)")
330-
runCmd.Flags().StringSliceVar(&cfg.AppNamePatterns, "match-application-name", nil, "patterns to match application name against")
331-
runCmd.Flags().StringVar(&cfg.AppLabel, "match-application-label", "", "label selector to match application labels against")
333+
334+
// DEPRECATED: These flags have been removed in the CRD branch and will be deprecated and removed in a future release.
335+
// The CRD branch introduces a new architecture that eliminates the need for these application matching flags.
336+
runCmd.Flags().StringSliceVar(&cfg.AppNamePatterns, "match-application-name", nil, "patterns to match application name against. DEPRECATED: this flag will be removed in a future version.")
337+
runCmd.Flags().StringVar(&cfg.AppLabel, "match-application-label", "", "label selector to match application labels against. DEPRECATED: this flag will be removed in a future version.")
338+
332339
runCmd.Flags().BoolVar(&warmUpCache, "warmup-cache", true, "whether to perform a cache warm-up on startup")
333340
runCmd.Flags().StringVar(&cfg.GitCommitUser, "git-commit-user", env.GetStringVal("GIT_COMMIT_USER", "argocd-image-updater"), "Username to use for Git commits")
334341
runCmd.Flags().StringVar(&cfg.GitCommitMail, "git-commit-email", env.GetStringVal("GIT_COMMIT_EMAIL", "[email protected]"), "E-Mail address to use for Git commits")

cmd/webhook.go

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,22 +165,29 @@ Supported registries:
165165
},
166166
}
167167

168+
// DEPRECATED: These flags have been removed in the CRD branch and will be deprecated and removed in a future release.
169+
// The CRD branch introduces a new architecture that eliminates the need for these native ArgoCD client configuration flags.
170+
webhookCmd.Flags().StringVar(&cfg.ApplicationsAPIKind, "applications-api", env.GetStringVal("APPLICATIONS_API", applicationsAPIKindK8S), "API kind that is used to manage Argo CD applications ('kubernetes' or 'argocd'). DEPRECATED: this flag will be removed in a future version.")
171+
webhookCmd.Flags().StringVar(&cfg.ClientOpts.ServerAddr, "argocd-server-addr", env.GetStringVal("ARGOCD_SERVER", ""), "address of ArgoCD API server. DEPRECATED: this flag will be removed in a future version.")
172+
webhookCmd.Flags().BoolVar(&cfg.ClientOpts.GRPCWeb, "argocd-grpc-web", env.GetBoolVal("ARGOCD_GRPC_WEB", false), "use grpc-web for connection to ArgoCD. DEPRECATED: this flag will be removed in a future version.")
173+
webhookCmd.Flags().BoolVar(&cfg.ClientOpts.Insecure, "argocd-insecure", env.GetBoolVal("ARGOCD_INSECURE", false), "(INSECURE) ignore invalid TLS certs for ArgoCD server. DEPRECATED: this flag will be removed in a future version.")
174+
webhookCmd.Flags().BoolVar(&cfg.ClientOpts.Plaintext, "argocd-plaintext", env.GetBoolVal("ARGOCD_PLAINTEXT", false), "(INSECURE) connect without TLS to ArgoCD server. DEPRECATED: this flag will be removed in a future version.")
175+
webhookCmd.Flags().StringVar(&cfg.ClientOpts.AuthToken, "argocd-auth-token", "", "use token for authenticating to ArgoCD (unsafe - consider setting ARGOCD_TOKEN env var instead). DEPRECATED: this flag will be removed in a future version.")
176+
webhookCmd.Flags().BoolVar(&disableKubernetes, "disable-kubernetes", false, "do not create and use a Kubernetes client. DEPRECATED: this flag will be removed in a future version.")
177+
168178
// Set Image Updater flags
169-
webhookCmd.Flags().StringVar(&cfg.ApplicationsAPIKind, "applications-api", env.GetStringVal("APPLICATIONS_API", applicationsAPIKindK8S), "API kind that is used to manage Argo CD applications ('kubernetes' or 'argocd')")
170-
webhookCmd.Flags().StringVar(&cfg.ClientOpts.ServerAddr, "argocd-server-addr", env.GetStringVal("ARGOCD_SERVER", ""), "address of ArgoCD API server")
171-
webhookCmd.Flags().BoolVar(&cfg.ClientOpts.GRPCWeb, "argocd-grpc-web", env.GetBoolVal("ARGOCD_GRPC_WEB", false), "use grpc-web for connection to ArgoCD")
172-
webhookCmd.Flags().BoolVar(&cfg.ClientOpts.Insecure, "argocd-insecure", env.GetBoolVal("ARGOCD_INSECURE", false), "(INSECURE) ignore invalid TLS certs for ArgoCD server")
173-
webhookCmd.Flags().BoolVar(&cfg.ClientOpts.Plaintext, "argocd-plaintext", env.GetBoolVal("ARGOCD_PLAINTEXT", false), "(INSECURE) connect without TLS to ArgoCD server")
174-
webhookCmd.Flags().StringVar(&cfg.ClientOpts.AuthToken, "argocd-auth-token", "", "use token for authenticating to ArgoCD (unsafe - consider setting ARGOCD_TOKEN env var instead)")
175179
webhookCmd.Flags().StringVar(&cfg.LogLevel, "loglevel", env.GetStringVal("IMAGE_UPDATER_LOGLEVEL", "info"), "set the loglevel to one of trace|debug|info|warn|error")
176180
webhookCmd.Flags().StringVar(&kubeConfig, "kubeconfig", "", "full path to kubernetes client configuration, i.e. ~/.kube/config")
177181
webhookCmd.Flags().StringVar(&cfg.RegistriesConf, "registries-conf-path", defaultRegistriesConfPath, "path to registries configuration file")
178-
webhookCmd.Flags().BoolVar(&disableKubernetes, "disable-kubernetes", false, "do not create and use a Kubernetes client")
179182
webhookCmd.Flags().IntVar(&cfg.MaxConcurrency, "max-concurrency", 10, "maximum number of update threads to run concurrently")
180183
webhookCmd.Flags().StringVar(&cfg.ArgocdNamespace, "argocd-namespace", "", "namespace where ArgoCD runs in (current namespace by default)")
181184
webhookCmd.Flags().StringVar(&cfg.AppNamespace, "application-namespace", v1.NamespaceAll, "namespace where Argo Image Updater will manage applications (all namespaces by default)")
182-
webhookCmd.Flags().StringSliceVar(&cfg.AppNamePatterns, "match-application-name", nil, "patterns to match application name against")
183-
webhookCmd.Flags().StringVar(&cfg.AppLabel, "match-application-label", "", "label selector to match application labels against")
185+
186+
// DEPRECATED: These flags have been removed in the CRD branch and will be deprecated and removed in a future release.
187+
// The CRD branch introduces a new architecture that eliminates the need for these application matching flags.
188+
webhookCmd.Flags().StringSliceVar(&cfg.AppNamePatterns, "match-application-name", nil, "patterns to match application name against. DEPRECATED: this flag will be removed in a future version.")
189+
webhookCmd.Flags().StringVar(&cfg.AppLabel, "match-application-label", "", "label selector to match application labels against. DEPRECATED: this flag will be removed in a future version.")
190+
184191
webhookCmd.Flags().StringVar(&cfg.GitCommitUser, "git-commit-user", env.GetStringVal("GIT_COMMIT_USER", "argocd-image-updater"), "Username to use for Git commits")
185192
webhookCmd.Flags().StringVar(&cfg.GitCommitMail, "git-commit-email", env.GetStringVal("GIT_COMMIT_EMAIL", "[email protected]"), "E-Mail address to use for Git commits")
186193
webhookCmd.Flags().StringVar(&cfg.GitCommitSigningKey, "git-commit-signing-key", env.GetStringVal("GIT_COMMIT_SIGNING_KEY", ""), "GnuPG key ID or path to Private SSH Key used to sign the commits")

docs/install/cmd/run.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@ API kind that is used to manage Argo CD applications ('kubernetes' or 'argocd')
2020

2121
Can also be set using the *APPLICATIONS_API* environment variable.
2222

23+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client configuration flag.
24+
2325
**--argocd-auth-token *token***
2426

2527
Use *token* for authenticating to the Argo CD API. This token must be a base64
2628
encoded JWT, as generated by Argo CD.
2729

2830
The token can also be set using the *ARGOCD_TOKEN* environment variable.
2931

32+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client configuration flag.
33+
3034
**--argocd-grpc-web**
3135

3236
If this flag is given, use the gRPC-web protocol to connect to the Argo CD API.
@@ -35,6 +39,8 @@ HTTP/2, or only accept HTTP/2 on the front end.
3539

3640
Can also be set using the *ARGOCD_GRPC_WEB* environment variable.
3741

42+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client configuration flag.
43+
3844
**--argocd-insecure**
3945

4046
If specified, the certificate of the Argo CD API server is not verified. Useful
@@ -44,6 +50,8 @@ production systems.
4450

4551
Can also be set using the *ARGOCD_INSECURE* environment variable.
4652

53+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client configuration flag.
54+
4755
**-argocd-namespace *namespace***
4856

4957
namespace where ArgoCD runs in (current namespace by default)
@@ -55,6 +63,8 @@ TLS.
5563

5664
Can also be set using the *ARGOCD_PLAINTEXT* environment variable.
5765

66+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client configuration flag.
67+
5868
**--argocd-server-addr *server address***
5969

6070
Connect to the Argo CD API server at *server address*. *server address* must
@@ -65,6 +75,8 @@ connections, and port 443 for TLS connections.
6575

6676
Can also be set using the *ARGOCD_SERVER* environment variable.
6777

78+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client configuration flag.
79+
6880
**--disable-kube-events**
6981

7082
Disable kubernetes events
@@ -78,6 +90,8 @@ cluster, this flag will prevent Argo CD Image Updater from creating a client
7890
to interact with Kubernetes. When Kubernetes access is disabled, pull secrets
7991
for images can only be specified from an environment variable.
8092

93+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client configuration flag.
94+
8195
**--dry-run**
8296

8397
If this flag is set, Argo CD Image Updater won't actually perform any changes
@@ -192,6 +206,8 @@ currently does not support pattern matching on label values (e.g `customer.label
192206
You can specify equality, inequality, or set based requirements or a combination.
193207
For e.g., `app,app!=foo,custom.label/name=xyz,customer in (a,b,c)`
194208

209+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for these application matching flag.
210+
195211
**--match-application-name *pattern***
196212

197213
Only process applications that have a valid annotation and matches the given
@@ -200,6 +216,8 @@ style wildcards, i.e. `*-staging` would match any application name with a
200216
suffix of `-staging`. Can be specified multiple times to define more than
201217
one pattern, from which at least one has to match.
202218

219+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for these application matching flag.
220+
203221
**--max-concurrency *number***
204222

205223
Process a maximum of *number* applications concurrently. To disable concurrent

docs/install/cmd/webhook.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,17 @@ API kind that is used to manage Argo CD applications ('kubernetes' or 'argocd')
2727

2828
Can also be set using the *APPLICATIONS_API* environment variable.
2929

30+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client configuration flag.
31+
3032
**--argocd-auth-token *token***
3133

3234
Use *token* for authenticating to the Argo CD API. This token must be a base64
3335
encoded JWT, as generated by Argo CD.
3436

3537
The token can also be set using the *ARGOCD_TOKEN* environment variable.
3638

39+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client configuration flag.
40+
3741
**--argocd-grpc-web**
3842

3943
If this flag is given, use the gRPC-web protocol to connect to the Argo CD API.
@@ -42,6 +46,8 @@ HTTP/2, or only accept HTTP/2 on the front end.
4246

4347
Can also be set using the *ARGOCD_GRPC_WEB* environment variable.
4448

49+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client configuration flag.
50+
4551
**--argocd-insecure**
4652

4753
If specified, the certificate of the Argo CD API server is not verified. Useful
@@ -51,6 +57,8 @@ production systems.
5157

5258
Can also be set using the *ARGOCD_INSECURE* environment variable.
5359

60+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client configuration flag.
61+
5462
**-argocd-namespace *namespace***
5563

5664
namespace where ArgoCD runs in (current namespace by default)
@@ -62,6 +70,8 @@ TLS.
6270

6371
Can also be set using the *ARGOCD_PLAINTEXT* environment variable.
6472

73+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client configuration flag.
74+
6575
**--argocd-server-addr *server address***
6676

6777
Connect to the Argo CD API server at *server address*. *server address* must
@@ -72,6 +82,8 @@ connections, and port 443 for TLS connections.
7282

7383
Can also be set using the *ARGOCD_SERVER* environment variable.
7484

85+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client configuration flag.
86+
7587
**--disable-kube-events**
7688

7789
Disable kubernetes events
@@ -85,6 +97,8 @@ cluster, this flag will prevent Argo CD Image Updater from creating a client
8597
to interact with Kubernetes. When Kubernetes access is disabled, pull secrets
8698
for images can only be specified from an environment variable.
8799

100+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client configuration flag.
101+
88102
**--docker-webhook-secret *secret***
89103

90104
Secret for validating Docker Hub webhooks.
@@ -164,6 +178,8 @@ currently does not support pattern matching on label values (e.g `customer.label
164178
You can specify equality, inequality, or set based requirements or a combination.
165179
For e.g., `app,app!=foo,custom.label/name=xyz,customer in (a,b,c)`
166180

181+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for these application matching flag.
182+
167183
**--match-application-name *pattern***
168184

169185
Only process applications that have a valid annotation and matches the given
@@ -172,6 +188,8 @@ style wildcards, i.e. `*-staging` would match any application name with a
172188
suffix of `-staging`. Can be specified multiple times to define more than
173189
one pattern, from which at least one has to match.
174190

191+
**DEPRECATED:** This flag has been removed in the CRD branch and will be deprecated and removed in a future release. The CRD branch introduces a new architecture that eliminates the need for these application matching flag.
192+
175193
**--max-concurrency *number***
176194

177195
Process a maximum of *number* applications concurrently. To disable concurrent

0 commit comments

Comments
 (0)