Long:"ArgoCD application controller is a Kubernetes controller that continuously monitors running applications and compares the current, live state against the desired target state (as specified in the repo). This command runs Application Controller in the foreground. It can be configured by following options.",
command.Flags().Int64Var(&appResyncPeriod,"app-resync",int64(env.ParseDurationFromEnv("ARGOCD_RECONCILIATION_TIMEOUT",defaultAppResyncPeriod*time.Second,0,math.MaxInt64).Seconds()),"Time period in seconds for application resync.")
command.Flags().Int64Var(&appHardResyncPeriod,"app-hard-resync",int64(env.ParseDurationFromEnv("ARGOCD_HARD_RECONCILIATION_TIMEOUT",defaultAppHardResyncPeriod*time.Second,0,math.MaxInt64).Seconds()),"Time period in seconds for application hard resync.")
command.Flags().Int64Var(&appResyncJitter,"app-resync-jitter",int64(env.ParseDurationFromEnv("ARGOCD_RECONCILIATION_JITTER",0*time.Second,0,math.MaxInt64).Seconds()),"Maximum time period in seconds to add as a delay jitter for application resync.")
command.Flags().Int64Var(&repoErrorGracePeriod,"repo-error-grace-period-seconds",int64(env.ParseDurationFromEnv("ARGOCD_REPO_ERROR_GRACE_PERIOD_SECONDS",defaultAppResyncPeriod*time.Second,0,math.MaxInt64).Seconds()),"Grace period in seconds for ignoring consecutive errors while communicating with repo server.")
command.Flags().StringVar(&repoServerAddress,"repo-server",env.StringFromEnv("ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER",common.DefaultRepoServerAddr),"Repo server address.")
command.Flags().IntVar(&statusProcessors,"status-processors",env.ParseNumFromEnv("ARGOCD_APPLICATION_CONTROLLER_STATUS_PROCESSORS",20,0,math.MaxInt32),"Number of application status processors")
command.Flags().IntVar(&operationProcessors,"operation-processors",env.ParseNumFromEnv("ARGOCD_APPLICATION_CONTROLLER_OPERATION_PROCESSORS",10,0,math.MaxInt32),"Number of application operation processors")
command.Flags().StringVar(&cmdutil.LogFormat,"logformat",env.StringFromEnv("ARGOCD_APPLICATION_CONTROLLER_LOGFORMAT","text"),"Set the logging format. One of: text|json")
command.Flags().StringVar(&cmdutil.LogLevel,"loglevel",env.StringFromEnv("ARGOCD_APPLICATION_CONTROLLER_LOGLEVEL","info"),"Set the logging level. One of: debug|info|warn|error")
command.Flags().DurationVar(&metricsCacheExpiration,"metrics-cache-expiration",env.ParseDurationFromEnv("ARGOCD_APPLICATION_CONTROLLER_METRICS_CACHE_EXPIRATION",0*time.Second,0,math.MaxInt64),"Prometheus metrics cache expiration (disabled by default. e.g. 24h0m0s)")
command.Flags().IntVar(&selfHealTimeoutSeconds,"self-heal-timeout-seconds",env.ParseNumFromEnv("ARGOCD_APPLICATION_CONTROLLER_SELF_HEAL_TIMEOUT_SECONDS",0,0,math.MaxInt32),"Specifies timeout between application self heal attempts")
command.Flags().IntVar(&selfHealBackoffTimeoutSeconds,"self-heal-backoff-timeout-seconds",env.ParseNumFromEnv("ARGOCD_APPLICATION_CONTROLLER_SELF_HEAL_BACKOFF_TIMEOUT_SECONDS",2,0,math.MaxInt32),"Specifies initial timeout of exponential backoff between self heal attempts")
command.Flags().IntVar(&selfHealBackoffFactor,"self-heal-backoff-factor",env.ParseNumFromEnv("ARGOCD_APPLICATION_CONTROLLER_SELF_HEAL_BACKOFF_FACTOR",3,0,math.MaxInt32),"Specifies factor of exponential timeout between application self heal attempts")
command.Flags().IntVar(&selfHealBackoffCapSeconds,"self-heal-backoff-cap-seconds",env.ParseNumFromEnv("ARGOCD_APPLICATION_CONTROLLER_SELF_HEAL_BACKOFF_CAP_SECONDS",300,0,math.MaxInt32),"Specifies max timeout of exponential backoff between application self heal attempts")
command.Flags().Int64Var(&kubectlParallelismLimit,"kubectl-parallelism-limit",env.ParseInt64FromEnv("ARGOCD_APPLICATION_CONTROLLER_KUBECTL_PARALLELISM_LIMIT",20,0,math.MaxInt64),"Number of allowed concurrent kubectl fork/execs. Any value less than 1 means no limit.")
command.Flags().BoolVar(&repoServerPlaintext,"repo-server-plaintext",env.ParseBoolFromEnv("ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER_PLAINTEXT",false),"Disable TLS on connections to repo server")
command.Flags().BoolVar(&repoServerStrictTLS,"repo-server-strict-tls",env.ParseBoolFromEnv("ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER_STRICT_TLS",false),"Whether to use strict validation of the TLS cert presented by the repo server")
command.Flags().StringSliceVar(&metricsAplicationLabels,"metrics-application-labels",[]string{},"List of Application labels that will be added to the argocd_application_labels metric")
command.Flags().StringSliceVar(&metricsAplicationConditions,"metrics-application-conditions",[]string{},"List of Application conditions that will be added to the argocd_application_conditions metric")
command.Flags().StringToStringVar(&otlpHeaders,"otlp-headers",env.ParseStringToStringFromEnv("ARGOCD_APPLICATION_CONTROLLER_OTLP_HEADERS",map[string]string{},","),"List of OpenTelemetry collector extra headers sent with traces, headers are comma-separated key-value pairs(e.g. key1=value1,key2=value2)")
command.Flags().StringSliceVar(&otlpAttrs,"otlp-attrs",env.StringsFromEnv("ARGOCD_APPLICATION_CONTROLLER_OTLP_ATTRS",[]string{},","),"List of OpenTelemetry collector extra attrs when send traces, each attribute is separated by a colon(e.g. key:value)")
command.Flags().StringSliceVar(&applicationNamespaces,"application-namespaces",env.StringsFromEnv("ARGOCD_APPLICATION_NAMESPACES",[]string{},","),"List of additional namespaces that applications are allowed to be reconciled from")
command.Flags().BoolVar(&persistResourceHealth,"persist-resource-health",env.ParseBoolFromEnv("ARGOCD_APPLICATION_CONTROLLER_PERSIST_RESOURCE_HEALTH",true),"Enables storing the managed resources health in the Application CRD")
command.Flags().Float64Var(&workqueueRateLimit.BucketQPS,"wq-bucket-qps",env.ParseFloat64FromEnv("WORKQUEUE_BUCKET_QPS",math.MaxFloat64,1,math.MaxFloat64),"Set Workqueue Rate Limiter Bucket QPS, default set to MaxFloat64 which disables the bucket limiter")
// when WORKQUEUE_FAILURE_COOLDOWN is 0 per item rate limiting is disabled(default)
command.Flags().DurationVar(&workqueueRateLimit.FailureCoolDown,"wq-cooldown-ns",time.Duration(env.ParseInt64FromEnv("WORKQUEUE_FAILURE_COOLDOWN_NS",0,0,(24*time.Hour).Nanoseconds())),"Set Workqueue Per Item Rate Limiter Cooldown duration in ns, default 0(per item rate limiter disabled)")
command.Flags().DurationVar(&workqueueRateLimit.BaseDelay,"wq-basedelay-ns",time.Duration(env.ParseInt64FromEnv("WORKQUEUE_BASE_DELAY_NS",time.Millisecond.Nanoseconds(),time.Nanosecond.Nanoseconds(),(24*time.Hour).Nanoseconds())),"Set Workqueue Per Item Rate Limiter Base Delay duration in nanoseconds, default 1000000 (1ms)")
command.Flags().DurationVar(&workqueueRateLimit.MaxDelay,"wq-maxdelay-ns",time.Duration(env.ParseInt64FromEnv("WORKQUEUE_MAX_DELAY_NS",time.Second.Nanoseconds(),1*time.Millisecond.Nanoseconds(),(24*time.Hour).Nanoseconds())),"Set Workqueue Per Item Rate Limiter Max Delay duration in nanoseconds, default 1000000000 (1s)")
command.Flags().Float64Var(&workqueueRateLimit.BackoffFactor,"wq-backoff-factor",env.ParseFloat64FromEnv("WORKQUEUE_BACKOFF_FACTOR",1.5,0,math.MaxFloat64),"Set Workqueue Per Item Rate Limiter Backoff Factor, default is 1.5")
command.Flags().BoolVar(&serverSideDiff,"server-side-diff-enabled",env.ParseBoolFromEnv(common.EnvServerSideDiff,false),"Feature flag to enable ServerSide diff. Default (\"false\")")
command.Flags().StringSliceVar(&enableK8sEvent,"enable-k8s-event",env.StringsFromEnv("ARGOCD_ENABLE_K8S_EVENT",argo.DefaultEnableEventList(),","),"Enable ArgoCD to use k8s event. For disabling all events, set the value as `none`. (e.g --enable-k8s-event=none), For enabling specific events, set the value as `event reason`. (e.g --enable-k8s-event=StatusRefreshed,ResourceCreated)")