From ffb1af7128708de756e62ceaa14416a8ac35b10a Mon Sep 17 00:00:00 2001 From: OpenGuidou Date: Tue, 15 Oct 2024 17:09:55 +0200 Subject: [PATCH] fix(api-server): Refresh correctly server when OIDC config changes Signed-off-by: OpenGuidou --- cmd/argocd-server/commands/argocd_server.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/argocd-server/commands/argocd_server.go b/cmd/argocd-server/commands/argocd_server.go index d1e9cf05f98d5..f10bd150fdbc5 100644 --- a/cmd/argocd-server/commands/argocd_server.go +++ b/cmd/argocd-server/commands/argocd_server.go @@ -247,11 +247,11 @@ func NewCommand() *cobra.Command { stats.RegisterStackDumper() stats.StartStatsTicker(10 * time.Minute) stats.RegisterHeapDumper("memprofile") - argocd := server.NewServer(ctx, argoCDOpts, appsetOpts) - argocd.Init(ctx) - lns, err := argocd.Listen() - errors.CheckError(err) for { + argocd := server.NewServer(ctx, argoCDOpts, appsetOpts) + argocd.Init(ctx) + lns, err := argocd.Listen() + errors.CheckError(err) var closer func() ctx, cancel := context.WithCancel(ctx) if otlpAddress != "" { @@ -265,6 +265,7 @@ func NewCommand() *cobra.Command { if closer != nil { closer() } + lns.Close() } }, Example: templates.Examples(`