From 30fbb403773e9f1ed6a353ca7680d7917fcf281c Mon Sep 17 00:00:00 2001 From: Juan Fernandez Date: Fri, 29 Aug 2025 14:02:59 -0400 Subject: [PATCH] Updating App config should use primary (#32428) For #28713 Refactored the PATH fleet/config end-point to use the primary DB node for both persisting changes and fetching modified App Config to avoid stale UI due to read replica delay. --- changes/28713-gitops-checkbox-status-replica-env | 1 + server/service/appconfig.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changes/28713-gitops-checkbox-status-replica-env diff --git a/changes/28713-gitops-checkbox-status-replica-env b/changes/28713-gitops-checkbox-status-replica-env new file mode 100644 index 0000000000..e06f820934 --- /dev/null +++ b/changes/28713-gitops-checkbox-status-replica-env @@ -0,0 +1 @@ +* Refactored PATH fleet/config end-point to use the primary DB node for both persisting changes and fetching modified App Config. \ No newline at end of file diff --git a/server/service/appconfig.go b/server/service/appconfig.go index 525a6fc965..b822f6464b 100644 --- a/server/service/appconfig.go +++ b/server/service/appconfig.go @@ -825,7 +825,7 @@ func (svc *Service) ModifyAppConfig(ctx context.Context, p []byte, applyOpts fle } // retrieve new app config with obfuscated secrets - obfuscatedAppConfig, err := svc.ds.AppConfig(ctx) + obfuscatedAppConfig, err := svc.ds.AppConfig(ctxdb.RequirePrimary(ctx, true)) if err != nil { return nil, err }