Skip to content

Commit

Permalink
fix: make WatchResourceTree use namespaced cache key (argoproj#15258)
Browse files Browse the repository at this point in the history
* fix: make WatchResourceTree use namespaced application cache key

Signed-off-by: Torbjørn Fjørtoft <torbjorn.fjortoft@pgs.com>

* chore: add PGS to USERS.md

Signed-off-by: Torbjørn Fjørtoft <torbjorn.fjortoft@pgs.com>

---------

Signed-off-by: Torbjørn Fjørtoft <torbjorn.fjortoft@pgs.com>
  • Loading branch information
torfjor authored Aug 30, 2023
1 parent ef24b3f commit d557be4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,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/)
Expand Down
5 changes: 3 additions & 2 deletions server/application/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -1399,9 +1399,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)
}
Expand Down

0 comments on commit d557be4

Please sign in to comment.