Skip to content

Commit

Permalink
fix: add enable-proxy-extension command flag
Browse files Browse the repository at this point in the history
Signed-off-by: Vasile Groza <[email protected]>
  • Loading branch information
vasilegroza committed Dec 3, 2024
1 parent 8da34fc commit f8a69ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions cmd/argocd-server/commands/argocd_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ func NewCommand() *cobra.Command {

// argocd k8s event logging flag
enableK8sEvent []string

// argocd ui extensions shared path
extensionsSharedPath string
)
command := &cobra.Command{
Use: cliName,
Expand Down Expand Up @@ -243,6 +246,7 @@ func NewCommand() *cobra.Command {
EnableProxyExtension: enableProxyExtension,
WebhookParallelism: webhookParallelism,
EnableK8sEvent: enableK8sEvent,
ExtensionsSharedPath: extensionsSharedPath,
}

appsetOpts := server.ApplicationSetOpts{
Expand Down Expand Up @@ -318,6 +322,7 @@ func NewCommand() *cobra.Command {
command.Flags().BoolVar(&enableProxyExtension, "enable-proxy-extension", env.ParseBoolFromEnv("ARGOCD_SERVER_ENABLE_PROXY_EXTENSION", false), "Enable Proxy Extension feature")
command.Flags().IntVar(&webhookParallelism, "webhook-parallelism-limit", env.ParseNumFromEnv("ARGOCD_SERVER_WEBHOOK_PARALLELISM_LIMIT", 50, 1, 1000), "Number of webhook requests processed concurrently")
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)")
command.Flags().StringVar(&extensionsSharedPath, "extensions-shared-path", env.StringFromEnv("ARGOCD_EXTENSIONS_SHARED_PATH", "/tmp/extensions"), "Directory path that contains UI extensions")

// Flags related to the applicationSet component.
command.Flags().StringVar(&scmRootCAPath, "appset-scm-root-ca-path", env.StringFromEnv("ARGOCD_APPLICATIONSET_CONTROLLER_SCM_ROOT_CA_PATH", ""), "Provide Root CA Path for self-signed TLS Certificates")
Expand Down
6 changes: 2 additions & 4 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ const (
maxConcurrentLoginRequestsCountEnv = "ARGOCD_MAX_CONCURRENT_LOGIN_REQUESTS_COUNT"
replicasCountEnv = "ARGOCD_API_SERVER_REPLICAS"
renewTokenKey = "renew-token"
extensionsSharedPathEnv = "ARGOCD_EXTENSIONS_SHARED_PATH"
)

// ErrNoSession indicates no auth token was supplied as part of a request
Expand Down Expand Up @@ -231,6 +230,7 @@ type ArgoCDServerOpts struct {
EnableProxyExtension bool
WebhookParallelism int
EnableK8sEvent []string
ExtensionsSharedPath string
}

type ApplicationSetOpts struct {
Expand Down Expand Up @@ -1101,10 +1101,8 @@ func (a *ArgoCDServer) newHTTPServer(ctx context.Context, port int, grpcWebHandl
registerDownloadHandlers(mux, "/download")

// Serve extensions
extensionsSharedPath := env.StringFromEnv(extensionsSharedPathEnv, "/tmp/extensions/")

var extensionsHandler http.Handler = http.HandlerFunc(func(writer http.ResponseWriter, _ *http.Request) {
a.serveExtensions(extensionsSharedPath, writer)
a.serveExtensions(a.ExtensionsSharedPath, writer)
})
if a.ArgoCDServerOpts.EnableGZip {
extensionsHandler = compressHandler(extensionsHandler)
Expand Down

0 comments on commit f8a69ae

Please sign in to comment.