Skip to content

Commit 160d17c

Browse files
committed
fix: return empty instead of error if cache unavailable
Signed-off-by: Peter Jiang <[email protected]>
1 parent 05ccc01 commit 160d17c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/application/application.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,8 @@ func (s *Server) ManagedResources(ctx context.Context, q *application.ResourcesQ
17711771
return s.cache.GetAppManagedResources(a.InstanceName(s.ns), &items)
17721772
})
17731773
if err != nil {
1774-
return nil, fmt.Errorf("error getting cached app managed resources: %w", err)
1774+
log.Warnf("Cache unavailable for %s/%s: %v. Returning empty managed resources.", a.Namespace, a.Name, err)
1775+
return &application.ManagedResourcesResponse{Items: []*v1alpha1.ResourceDiff{}}, nil
17751776
}
17761777
res := &application.ManagedResourcesResponse{}
17771778
for i := range items {

0 commit comments

Comments
 (0)