From 3cc00d2c77ae7b55c27e480be54fb1a06dc9eda0 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 12:00:31 -0400 Subject: [PATCH] fix: make WatchResourceTree use namespaced cache key (#15258) (#15523) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: make WatchResourceTree use namespaced application cache key * chore: add PGS to USERS.md --------- Signed-off-by: Torbjørn Fjørtoft Co-authored-by: Torbjørn Fjørtoft --- USERS.md | 1 + server/application/application.go | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/USERS.md b/USERS.md index 3cace33265d03..3f546d591f11b 100644 --- a/USERS.md +++ b/USERS.md @@ -187,6 +187,7 @@ Currently, the following organizations are **officially** using Argo CD: 1. [Patreon](https://www.patreon.com/) 1. [PayPay](https://paypay.ne.jp/) 1. [Peloton Interactive](https://www.onepeloton.com/) +1. [PGS](https://www.pgs.com) 1. [Pigment](https://www.gopigment.com/) 1. [Pipefy](https://www.pipefy.com/) 1. [Pismo](https://pismo.io/) diff --git a/server/application/application.go b/server/application/application.go index 8097185a7cb33..9e3bbb6d0d1aa 100644 --- a/server/application/application.go +++ b/server/application/application.go @@ -1339,9 +1339,10 @@ func (s *Server) WatchResourceTree(q *application.ResourcesQuery, ws application return err } - return s.cache.OnAppResourcesTreeChanged(ws.Context(), q.GetApplicationName(), func() error { + cacheKey := argo.AppInstanceName(q.GetApplicationName(), q.GetAppNamespace(), s.ns) + return s.cache.OnAppResourcesTreeChanged(ws.Context(), cacheKey, func() error { var tree appv1.ApplicationTree - err := s.cache.GetAppResourcesTree(q.GetApplicationName(), &tree) + err := s.cache.GetAppResourcesTree(cacheKey, &tree) if err != nil { return fmt.Errorf("error getting app resource tree: %w", err) }