From 6dcc01dc65d2c2978ae299544963747d17b6664c Mon Sep 17 00:00:00 2001 From: Denis Karpelevich <56302307+dkarpele@users.noreply.github.com> Date: Mon, 25 Aug 2025 21:37:42 +0200 Subject: [PATCH 1/2] chore(crd): add deprecation warnings for CRD branch removed functionality Add deprecation comments to functions, structs, constants, and flags that were removed in the CRD branch to notify users of upcoming breaking changes. Signed-off-by: Denis Karpelevich <56302307+dkarpele@users.noreply.github.com> --- cmd/run.go | 9 ++++++++- pkg/argocd/argocd.go | 12 ++++++++++++ registry-scanner/pkg/common/constants.go | 8 ++++++++ registry-scanner/pkg/common/helper.go | 2 ++ registry-scanner/pkg/image/options.go | 18 ++++++++++++++++++ 5 files changed, 48 insertions(+), 1 deletion(-) diff --git a/cmd/run.go b/cmd/run.go index cadc4618..c1fe905d 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -309,12 +309,16 @@ func newRunCommand() *cobra.Command { }, } + // DEPRECATED: These flags have been removed in the CRD branch and will be deprecated in a future release. + // The CRD branch introduces a new architecture that eliminates the need for these native ArgoCD client configuration flags. 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')") runCmd.Flags().StringVar(&cfg.ClientOpts.ServerAddr, "argocd-server-addr", env.GetStringVal("ARGOCD_SERVER", ""), "address of ArgoCD API server") runCmd.Flags().BoolVar(&cfg.ClientOpts.GRPCWeb, "argocd-grpc-web", env.GetBoolVal("ARGOCD_GRPC_WEB", false), "use grpc-web for connection to ArgoCD") runCmd.Flags().BoolVar(&cfg.ClientOpts.Insecure, "argocd-insecure", env.GetBoolVal("ARGOCD_INSECURE", false), "(INSECURE) ignore invalid TLS certs for ArgoCD server") runCmd.Flags().BoolVar(&cfg.ClientOpts.Plaintext, "argocd-plaintext", env.GetBoolVal("ARGOCD_PLAINTEXT", false), "(INSECURE) connect without TLS to ArgoCD server") runCmd.Flags().StringVar(&cfg.ClientOpts.AuthToken, "argocd-auth-token", "", "use token for authenticating to ArgoCD (unsafe - consider setting ARGOCD_TOKEN env var instead)") + runCmd.Flags().BoolVar(&disableKubernetes, "disable-kubernetes", false, "do not create and use a Kubernetes client") + runCmd.Flags().BoolVar(&cfg.DryRun, "dry-run", false, "run in dry-run mode. If set to true, do not perform any changes") runCmd.Flags().DurationVar(&cfg.CheckInterval, "interval", env.GetDurationVal("IMAGE_UPDATER_INTERVAL", 2*time.Minute), "interval for how often to check for updates") 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 { runCmd.Flags().IntVar(&cfg.MetricsPort, "metrics-port", 8081, "port to start the metrics server on, 0 to disable") runCmd.Flags().BoolVar(&once, "once", false, "run only once, same as specifying --interval=0 and --health-port=0") runCmd.Flags().StringVar(&cfg.RegistriesConf, "registries-conf-path", defaultRegistriesConfPath, "path to registries configuration file") - 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", "", "namespace where ArgoCD runs in (current namespace by default)") runCmd.Flags().StringVar(&cfg.AppNamespace, "application-namespace", v1.NamespaceAll, "namespace where Argo Image Updater will manage applications (all namespaces by default)") + + // DEPRECATED: These flags have been removed in the CRD branch and will be deprecated in a future release. + // The CRD branch introduces a new architecture that eliminates the need for these application matching flags. runCmd.Flags().StringSliceVar(&cfg.AppNamePatterns, "match-application-name", nil, "patterns to match application name 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") diff --git a/pkg/argocd/argocd.go b/pkg/argocd/argocd.go index a06d351a..5ad11783 100644 --- a/pkg/argocd/argocd.go +++ b/pkg/argocd/argocd.go @@ -126,6 +126,8 @@ func NewK8SClient(kubeClient *kube.ImageUpdaterKubernetesClient, opts *K8SClient }, nil } +// DEPRECATED: This struct and its associated client have been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client approach. // Native type argoCD struct { Client argocdclient.Client @@ -147,6 +149,8 @@ const ( ApplicationTypeKustomize ApplicationType = 2 ) +// DEPRECATED: This struct and its associated client have been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client approach. // Basic wrapper struct for ArgoCD client options type ClientOptions struct { ServerAddr string @@ -158,6 +162,8 @@ type ClientOptions struct { AuthToken string } +// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client approach. // NewAPIClient creates a new API client for ArgoCD and connects to the ArgoCD // API server. func NewAPIClient(opts *ClientOptions) (ArgoCD, error) { @@ -264,6 +270,8 @@ func parseImageList(annotations map[string]string) *image.ContainerImageList { return &results } +// DEPRECATED: This struct and its associated client have been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client approach. // GetApplication gets the application named appName from Argo CD API func (client *argoCD) GetApplication(ctx context.Context, appName string) (*v1alpha1.Application, error) { conn, appClient, err := client.Client.NewApplicationClient() @@ -284,6 +292,8 @@ func (client *argoCD) GetApplication(ctx context.Context, appName string) (*v1al return app, nil } +// DEPRECATED: This struct and its associated client have been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client approach. // ListApplications returns a list of all application names that the API user // has access to. func (client *argoCD) ListApplications(labelSelector string) ([]v1alpha1.Application, error) { @@ -305,6 +315,8 @@ func (client *argoCD) ListApplications(labelSelector string) ([]v1alpha1.Applica return apps.Items, nil } +// DEPRECATED: This struct and its associated client have been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this native ArgoCD client approach. // UpdateSpec updates the spec for given application func (client *argoCD) UpdateSpec(ctx context.Context, in *application.ApplicationUpdateSpecRequest) (*v1alpha1.ApplicationSpec, error) { conn, appClient, err := client.Client.NewApplicationClient() diff --git a/registry-scanner/pkg/common/constants.go b/registry-scanner/pkg/common/constants.go index b2b889bf..eca0d213 100644 --- a/registry-scanner/pkg/common/constants.go +++ b/registry-scanner/pkg/common/constants.go @@ -8,6 +8,8 @@ const ( DefaultHelmImageTag = "image.tag" ) +// DEPRECATED: These constants have been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for these annotation-based constants. // Helm related annotations const ( HelmParamImageNameAnnotationSuffix = "/%s.helm.image-name" @@ -15,11 +17,15 @@ const ( HelmParamImageSpecAnnotationSuffix = "/%s.helm.image-spec" ) +// DEPRECATED: These constants have been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for these annotation-based constants. // Kustomize related annotations const ( KustomizeApplicationNameAnnotationSuffix = "/%s.kustomize.image-name" ) +// DEPRECATED: These constants have been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for these annotation-based constants. // Image specific configuration annotations const ( OldMatchOptionAnnotationSuffix = "/%s.tag-match" // Deprecated and will be removed @@ -31,6 +37,8 @@ const ( PlatformsAnnotationSuffix = "/%s.platforms" ) +// DEPRECATED: These constants have been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for these annotation-based constants. // Application-wide update strategy related annotations const ( ApplicationWideAllowTagsOptionAnnotationSuffix = "/allow-tags" diff --git a/registry-scanner/pkg/common/helper.go b/registry-scanner/pkg/common/helper.go index f23e7559..8450b2ab 100644 --- a/registry-scanner/pkg/common/helper.go +++ b/registry-scanner/pkg/common/helper.go @@ -2,6 +2,8 @@ package common // This file contains a helper function to retrieve prefixed value of the constants +// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this annotation-based approach. // Prefixed returns the annotation of the constant prefixed with the given prefix func Prefixed(prefix string, annotation string) string { return prefix + annotation diff --git a/registry-scanner/pkg/image/options.go b/registry-scanner/pkg/image/options.go index 308569c4..b3a909a0 100644 --- a/registry-scanner/pkg/image/options.go +++ b/registry-scanner/pkg/image/options.go @@ -10,6 +10,8 @@ import ( "github.com/argoproj-labs/argocd-image-updater/registry-scanner/pkg/options" ) +// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this annotation-based approach. // GetParameterHelmImageName gets the value for image-name option for the image // from a set of annotations func (img *ContainerImage) GetParameterHelmImageName(annotations map[string]string, annotationPrefix string) string { @@ -21,6 +23,8 @@ func (img *ContainerImage) GetParameterHelmImageName(annotations map[string]stri return val } +// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this annotation-based approach. // GetParameterHelmImageTag gets the value for image-tag option for the image // from a set of annotations func (img *ContainerImage) GetParameterHelmImageTag(annotations map[string]string, annotationPrefix string) string { @@ -32,6 +36,8 @@ func (img *ContainerImage) GetParameterHelmImageTag(annotations map[string]strin return val } +// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this annotation-based approach. // GetParameterHelmImageSpec gets the value for image-spec option for the image // from a set of annotations func (img *ContainerImage) GetParameterHelmImageSpec(annotations map[string]string, annotationPrefix string) string { @@ -43,6 +49,8 @@ func (img *ContainerImage) GetParameterHelmImageSpec(annotations map[string]stri return val } +// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this annotation-based approach. // GetParameterKustomizeImageName gets the value for image-spec option for the // image from a set of annotations func (img *ContainerImage) GetParameterKustomizeImageName(annotations map[string]string, annotationPrefix string) string { @@ -54,6 +62,8 @@ func (img *ContainerImage) GetParameterKustomizeImageName(annotations map[string return val } +// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this annotation-based approach. // HasForceUpdateOptionAnnotation gets the value for force-update option for the // image from a set of annotations func (img *ContainerImage) HasForceUpdateOptionAnnotation(annotations map[string]string, annotationPrefix string) bool { @@ -71,6 +81,8 @@ func (img *ContainerImage) HasForceUpdateOptionAnnotation(annotations map[string return forceUpdateVal == "true" } +// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this annotation-based approach. // GetParameterSort gets and validates the value for the sort option for the // image from a set of annotations func (img *ContainerImage) GetParameterUpdateStrategy(annotations map[string]string, annotationPrefix string) UpdateStrategy { @@ -118,6 +130,8 @@ func (img *ContainerImage) ParseUpdateStrategy(val string) UpdateStrategy { } } +// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this annotation-based approach. // GetParameterMatch returns the match function and pattern to use for matching // tag names. If an invalid option is found, it returns MatchFuncNone as the // default, to prevent accidental matches. @@ -179,6 +193,8 @@ func (img *ContainerImage) ParseMatchfunc(val string) (MatchFuncFn, interface{}) } } +// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this annotation-based approach. // GetParameterPullSecret retrieves an image's pull secret credentials func (img *ContainerImage) GetParameterPullSecret(annotations map[string]string, annotationPrefix string) *CredentialSource { pullSecretAnnotations := []string{ @@ -205,6 +221,8 @@ func (img *ContainerImage) GetParameterPullSecret(annotations map[string]string, return credSrc } +// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// The CRD branch introduces a new architecture that eliminates the need for this annotation-based approach. // GetParameterIgnoreTags retrieves a list of tags to ignore from a comma-separated string func (img *ContainerImage) GetParameterIgnoreTags(annotations map[string]string, annotationPrefix string) []string { ignoreTagsAnnotations := []string{ From d4088c57b526c8a543f12a5cf02fb80bee792f54 Mon Sep 17 00:00:00 2001 From: Denis Karpelevich <56302307+dkarpele@users.noreply.github.com> Date: Tue, 26 Aug 2025 18:47:29 +0200 Subject: [PATCH 2/2] chore(crd): address review comments Signed-off-by: Denis Karpelevich <56302307+dkarpele@users.noreply.github.com> --- cmd/run.go | 22 ++++++++++----------- cmd/webhook.go | 25 +++++++++++++++--------- docs/install/cmd/run.md | 18 +++++++++++++++++ docs/install/cmd/webhook.md | 18 +++++++++++++++++ pkg/argocd/argocd.go | 12 ++++++------ registry-scanner/pkg/common/constants.go | 8 ++++---- registry-scanner/pkg/common/helper.go | 2 +- registry-scanner/pkg/image/options.go | 18 ++++++++--------- 8 files changed, 83 insertions(+), 40 deletions(-) diff --git a/cmd/run.go b/cmd/run.go index c1fe905d..1113c2d6 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -309,15 +309,15 @@ func newRunCommand() *cobra.Command { }, } - // DEPRECATED: These flags have been removed in the CRD branch and will be deprecated in a future release. + // DEPRECATED: These flags have 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 native ArgoCD client configuration flags. - 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')") - runCmd.Flags().StringVar(&cfg.ClientOpts.ServerAddr, "argocd-server-addr", env.GetStringVal("ARGOCD_SERVER", ""), "address of ArgoCD API server") - runCmd.Flags().BoolVar(&cfg.ClientOpts.GRPCWeb, "argocd-grpc-web", env.GetBoolVal("ARGOCD_GRPC_WEB", false), "use grpc-web for connection to ArgoCD") - runCmd.Flags().BoolVar(&cfg.ClientOpts.Insecure, "argocd-insecure", env.GetBoolVal("ARGOCD_INSECURE", false), "(INSECURE) ignore invalid TLS certs for ArgoCD server") - runCmd.Flags().BoolVar(&cfg.ClientOpts.Plaintext, "argocd-plaintext", env.GetBoolVal("ARGOCD_PLAINTEXT", false), "(INSECURE) connect without TLS to ArgoCD server") - runCmd.Flags().StringVar(&cfg.ClientOpts.AuthToken, "argocd-auth-token", "", "use token for authenticating to ArgoCD (unsafe - consider setting ARGOCD_TOKEN env var instead)") - runCmd.Flags().BoolVar(&disableKubernetes, "disable-kubernetes", false, "do not create and use a Kubernetes client") + 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.") + 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.") + 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.") + 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.") + 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.") + 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.") + 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.") runCmd.Flags().BoolVar(&cfg.DryRun, "dry-run", false, "run in dry-run mode. If set to true, do not perform any changes") runCmd.Flags().DurationVar(&cfg.CheckInterval, "interval", env.GetDurationVal("IMAGE_UPDATER_INTERVAL", 2*time.Minute), "interval for how often to check for updates") @@ -331,10 +331,10 @@ func newRunCommand() *cobra.Command { runCmd.Flags().StringVar(&cfg.ArgocdNamespace, "argocd-namespace", "", "namespace where ArgoCD runs in (current namespace by default)") runCmd.Flags().StringVar(&cfg.AppNamespace, "application-namespace", v1.NamespaceAll, "namespace where Argo Image Updater will manage applications (all namespaces by default)") - // DEPRECATED: These flags have been removed in the CRD branch and will be deprecated in a future release. + // DEPRECATED: These flags have 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 flags. - runCmd.Flags().StringSliceVar(&cfg.AppNamePatterns, "match-application-name", nil, "patterns to match application name against") - runCmd.Flags().StringVar(&cfg.AppLabel, "match-application-label", "", "label selector to match application labels against") + 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.") + 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.") 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") diff --git a/cmd/webhook.go b/cmd/webhook.go index f4cff703..f4641098 100644 --- a/cmd/webhook.go +++ b/cmd/webhook.go @@ -165,22 +165,29 @@ Supported registries: }, } + // DEPRECATED: These flags have 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 native ArgoCD client configuration flags. + 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.") + 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.") + 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.") + 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.") + 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.") + 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.") + 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.") + // Set Image Updater flags - 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')") - webhookCmd.Flags().StringVar(&cfg.ClientOpts.ServerAddr, "argocd-server-addr", env.GetStringVal("ARGOCD_SERVER", ""), "address of ArgoCD API server") - webhookCmd.Flags().BoolVar(&cfg.ClientOpts.GRPCWeb, "argocd-grpc-web", env.GetBoolVal("ARGOCD_GRPC_WEB", false), "use grpc-web for connection to ArgoCD") - webhookCmd.Flags().BoolVar(&cfg.ClientOpts.Insecure, "argocd-insecure", env.GetBoolVal("ARGOCD_INSECURE", false), "(INSECURE) ignore invalid TLS certs for ArgoCD server") - webhookCmd.Flags().BoolVar(&cfg.ClientOpts.Plaintext, "argocd-plaintext", env.GetBoolVal("ARGOCD_PLAINTEXT", false), "(INSECURE) connect without TLS to ArgoCD server") - webhookCmd.Flags().StringVar(&cfg.ClientOpts.AuthToken, "argocd-auth-token", "", "use token for authenticating to ArgoCD (unsafe - consider setting ARGOCD_TOKEN env var instead)") webhookCmd.Flags().StringVar(&cfg.LogLevel, "loglevel", env.GetStringVal("IMAGE_UPDATER_LOGLEVEL", "info"), "set the loglevel to one of trace|debug|info|warn|error") webhookCmd.Flags().StringVar(&kubeConfig, "kubeconfig", "", "full path to kubernetes client configuration, i.e. ~/.kube/config") webhookCmd.Flags().StringVar(&cfg.RegistriesConf, "registries-conf-path", defaultRegistriesConfPath, "path to registries configuration file") - webhookCmd.Flags().BoolVar(&disableKubernetes, "disable-kubernetes", false, "do not create and use a Kubernetes client") webhookCmd.Flags().IntVar(&cfg.MaxConcurrency, "max-concurrency", 10, "maximum number of update threads to run concurrently") webhookCmd.Flags().StringVar(&cfg.ArgocdNamespace, "argocd-namespace", "", "namespace where ArgoCD runs in (current namespace by default)") webhookCmd.Flags().StringVar(&cfg.AppNamespace, "application-namespace", v1.NamespaceAll, "namespace where Argo Image Updater will manage applications (all namespaces by default)") - webhookCmd.Flags().StringSliceVar(&cfg.AppNamePatterns, "match-application-name", nil, "patterns to match application name against") - webhookCmd.Flags().StringVar(&cfg.AppLabel, "match-application-label", "", "label selector to match application labels against") + + // DEPRECATED: These flags have 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 flags. + 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.") + 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.") + webhookCmd.Flags().StringVar(&cfg.GitCommitUser, "git-commit-user", env.GetStringVal("GIT_COMMIT_USER", "argocd-image-updater"), "Username to use for Git commits") webhookCmd.Flags().StringVar(&cfg.GitCommitMail, "git-commit-email", env.GetStringVal("GIT_COMMIT_EMAIL", "noreply@argoproj.io"), "E-Mail address to use for Git commits") 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") diff --git a/docs/install/cmd/run.md b/docs/install/cmd/run.md index 03c627ad..99cabd1d 100644 --- a/docs/install/cmd/run.md +++ b/docs/install/cmd/run.md @@ -20,6 +20,8 @@ API kind that is used to manage Argo CD applications ('kubernetes' or 'argocd') Can also be set using the *APPLICATIONS_API* environment variable. +**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. + **--argocd-auth-token *token*** Use *token* for authenticating to the Argo CD API. This token must be a base64 @@ -27,6 +29,8 @@ encoded JWT, as generated by Argo CD. The token can also be set using the *ARGOCD_TOKEN* environment variable. +**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. + **--argocd-grpc-web** 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. Can also be set using the *ARGOCD_GRPC_WEB* environment variable. +**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. + **--argocd-insecure** If specified, the certificate of the Argo CD API server is not verified. Useful @@ -44,6 +50,8 @@ production systems. Can also be set using the *ARGOCD_INSECURE* environment variable. +**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. + **-argocd-namespace *namespace*** namespace where ArgoCD runs in (current namespace by default) @@ -55,6 +63,8 @@ TLS. Can also be set using the *ARGOCD_PLAINTEXT* environment variable. +**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. + **--argocd-server-addr *server address*** Connect to the Argo CD API server at *server address*. *server address* must @@ -65,6 +75,8 @@ connections, and port 443 for TLS connections. Can also be set using the *ARGOCD_SERVER* environment variable. +**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. + **--disable-kube-events** Disable kubernetes events @@ -78,6 +90,8 @@ cluster, this flag will prevent Argo CD Image Updater from creating a client to interact with Kubernetes. When Kubernetes access is disabled, pull secrets for images can only be specified from an environment variable. +**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. + **--dry-run** 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 You can specify equality, inequality, or set based requirements or a combination. For e.g., `app,app!=foo,custom.label/name=xyz,customer in (a,b,c)` +**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. + **--match-application-name *pattern*** 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 suffix of `-staging`. Can be specified multiple times to define more than one pattern, from which at least one has to match. +**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. + **--max-concurrency *number*** Process a maximum of *number* applications concurrently. To disable concurrent diff --git a/docs/install/cmd/webhook.md b/docs/install/cmd/webhook.md index 06a8acea..b248f7ef 100644 --- a/docs/install/cmd/webhook.md +++ b/docs/install/cmd/webhook.md @@ -27,6 +27,8 @@ API kind that is used to manage Argo CD applications ('kubernetes' or 'argocd') Can also be set using the *APPLICATIONS_API* environment variable. +**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. + **--argocd-auth-token *token*** Use *token* for authenticating to the Argo CD API. This token must be a base64 @@ -34,6 +36,8 @@ encoded JWT, as generated by Argo CD. The token can also be set using the *ARGOCD_TOKEN* environment variable. +**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. + **--argocd-grpc-web** 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. Can also be set using the *ARGOCD_GRPC_WEB* environment variable. +**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. + **--argocd-insecure** If specified, the certificate of the Argo CD API server is not verified. Useful @@ -51,6 +57,8 @@ production systems. Can also be set using the *ARGOCD_INSECURE* environment variable. +**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. + **-argocd-namespace *namespace*** namespace where ArgoCD runs in (current namespace by default) @@ -62,6 +70,8 @@ TLS. Can also be set using the *ARGOCD_PLAINTEXT* environment variable. +**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. + **--argocd-server-addr *server address*** Connect to the Argo CD API server at *server address*. *server address* must @@ -72,6 +82,8 @@ connections, and port 443 for TLS connections. Can also be set using the *ARGOCD_SERVER* environment variable. +**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. + **--disable-kube-events** Disable kubernetes events @@ -85,6 +97,8 @@ cluster, this flag will prevent Argo CD Image Updater from creating a client to interact with Kubernetes. When Kubernetes access is disabled, pull secrets for images can only be specified from an environment variable. +**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. + **--docker-webhook-secret *secret*** Secret for validating Docker Hub webhooks. @@ -164,6 +178,8 @@ currently does not support pattern matching on label values (e.g `customer.label You can specify equality, inequality, or set based requirements or a combination. For e.g., `app,app!=foo,custom.label/name=xyz,customer in (a,b,c)` +**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. + **--match-application-name *pattern*** 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 suffix of `-staging`. Can be specified multiple times to define more than one pattern, from which at least one has to match. +**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. + **--max-concurrency *number*** Process a maximum of *number* applications concurrently. To disable concurrent diff --git a/pkg/argocd/argocd.go b/pkg/argocd/argocd.go index 5ad11783..59eca0ea 100644 --- a/pkg/argocd/argocd.go +++ b/pkg/argocd/argocd.go @@ -126,7 +126,7 @@ func NewK8SClient(kubeClient *kube.ImageUpdaterKubernetesClient, opts *K8SClient }, nil } -// DEPRECATED: This struct and its associated client have been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This struct and its associated client have 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 approach. // Native type argoCD struct { @@ -149,7 +149,7 @@ const ( ApplicationTypeKustomize ApplicationType = 2 ) -// DEPRECATED: This struct and its associated client have been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This struct and its associated client have 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 approach. // Basic wrapper struct for ArgoCD client options type ClientOptions struct { @@ -162,7 +162,7 @@ type ClientOptions struct { AuthToken string } -// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This function 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 approach. // NewAPIClient creates a new API client for ArgoCD and connects to the ArgoCD // API server. @@ -270,7 +270,7 @@ func parseImageList(annotations map[string]string) *image.ContainerImageList { return &results } -// DEPRECATED: This struct and its associated client have been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This struct and its associated client have 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 approach. // GetApplication gets the application named appName from Argo CD API func (client *argoCD) GetApplication(ctx context.Context, appName string) (*v1alpha1.Application, error) { @@ -292,7 +292,7 @@ func (client *argoCD) GetApplication(ctx context.Context, appName string) (*v1al return app, nil } -// DEPRECATED: This struct and its associated client have been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This struct and its associated client have 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 approach. // ListApplications returns a list of all application names that the API user // has access to. @@ -315,7 +315,7 @@ func (client *argoCD) ListApplications(labelSelector string) ([]v1alpha1.Applica return apps.Items, nil } -// DEPRECATED: This struct and its associated client have been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This struct and its associated client have 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 approach. // UpdateSpec updates the spec for given application func (client *argoCD) UpdateSpec(ctx context.Context, in *application.ApplicationUpdateSpecRequest) (*v1alpha1.ApplicationSpec, error) { diff --git a/registry-scanner/pkg/common/constants.go b/registry-scanner/pkg/common/constants.go index eca0d213..25e32474 100644 --- a/registry-scanner/pkg/common/constants.go +++ b/registry-scanner/pkg/common/constants.go @@ -8,7 +8,7 @@ const ( DefaultHelmImageTag = "image.tag" ) -// DEPRECATED: These constants have been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: These constants have 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 annotation-based constants. // Helm related annotations const ( @@ -17,14 +17,14 @@ const ( HelmParamImageSpecAnnotationSuffix = "/%s.helm.image-spec" ) -// DEPRECATED: These constants have been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: These constants have 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 annotation-based constants. // Kustomize related annotations const ( KustomizeApplicationNameAnnotationSuffix = "/%s.kustomize.image-name" ) -// DEPRECATED: These constants have been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: These constants have 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 annotation-based constants. // Image specific configuration annotations const ( @@ -37,7 +37,7 @@ const ( PlatformsAnnotationSuffix = "/%s.platforms" ) -// DEPRECATED: These constants have been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: These constants have 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 annotation-based constants. // Application-wide update strategy related annotations const ( diff --git a/registry-scanner/pkg/common/helper.go b/registry-scanner/pkg/common/helper.go index 8450b2ab..926c1519 100644 --- a/registry-scanner/pkg/common/helper.go +++ b/registry-scanner/pkg/common/helper.go @@ -2,7 +2,7 @@ package common // This file contains a helper function to retrieve prefixed value of the constants -// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This function 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 annotation-based approach. // Prefixed returns the annotation of the constant prefixed with the given prefix func Prefixed(prefix string, annotation string) string { diff --git a/registry-scanner/pkg/image/options.go b/registry-scanner/pkg/image/options.go index b3a909a0..fb8f8e4a 100644 --- a/registry-scanner/pkg/image/options.go +++ b/registry-scanner/pkg/image/options.go @@ -10,7 +10,7 @@ import ( "github.com/argoproj-labs/argocd-image-updater/registry-scanner/pkg/options" ) -// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This function 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 annotation-based approach. // GetParameterHelmImageName gets the value for image-name option for the image // from a set of annotations @@ -23,7 +23,7 @@ func (img *ContainerImage) GetParameterHelmImageName(annotations map[string]stri return val } -// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This function 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 annotation-based approach. // GetParameterHelmImageTag gets the value for image-tag option for the image // from a set of annotations @@ -36,7 +36,7 @@ func (img *ContainerImage) GetParameterHelmImageTag(annotations map[string]strin return val } -// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This function 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 annotation-based approach. // GetParameterHelmImageSpec gets the value for image-spec option for the image // from a set of annotations @@ -49,7 +49,7 @@ func (img *ContainerImage) GetParameterHelmImageSpec(annotations map[string]stri return val } -// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This function 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 annotation-based approach. // GetParameterKustomizeImageName gets the value for image-spec option for the // image from a set of annotations @@ -62,7 +62,7 @@ func (img *ContainerImage) GetParameterKustomizeImageName(annotations map[string return val } -// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This function 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 annotation-based approach. // HasForceUpdateOptionAnnotation gets the value for force-update option for the // image from a set of annotations @@ -81,7 +81,7 @@ func (img *ContainerImage) HasForceUpdateOptionAnnotation(annotations map[string return forceUpdateVal == "true" } -// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This function 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 annotation-based approach. // GetParameterSort gets and validates the value for the sort option for the // image from a set of annotations @@ -130,7 +130,7 @@ func (img *ContainerImage) ParseUpdateStrategy(val string) UpdateStrategy { } } -// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This function 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 annotation-based approach. // GetParameterMatch returns the match function and pattern to use for matching // tag names. If an invalid option is found, it returns MatchFuncNone as the @@ -193,7 +193,7 @@ func (img *ContainerImage) ParseMatchfunc(val string) (MatchFuncFn, interface{}) } } -// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This function 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 annotation-based approach. // GetParameterPullSecret retrieves an image's pull secret credentials func (img *ContainerImage) GetParameterPullSecret(annotations map[string]string, annotationPrefix string) *CredentialSource { @@ -221,7 +221,7 @@ func (img *ContainerImage) GetParameterPullSecret(annotations map[string]string, return credSrc } -// DEPRECATED: This function has been removed in the CRD branch and will be deprecated in a future release. +// DEPRECATED: This function 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 annotation-based approach. // GetParameterIgnoreTags retrieves a list of tags to ignore from a comma-separated string func (img *ContainerImage) GetParameterIgnoreTags(annotations map[string]string, annotationPrefix string) []string {