From 2b915fe0a3b1a79f6f1c8b442c6e6245739d943c Mon Sep 17 00:00:00 2001 From: roi-codefresh Date: Wed, 11 May 2022 18:34:55 +0300 Subject: [PATCH] fixed app deletion events sometimes not being sent (#87) --- VERSION | 2 +- server/application/application.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 5cee2412bc542..34686ab157255 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.14-cap-CR-11584-fix-resource-cache +2.1.14-cap-CR-11708-send-app-deletion diff --git a/server/application/application.go b/server/application/application.go index ce48a7703e90b..47e60b9cc565d 100644 --- a/server/application/application.go +++ b/server/application/application.go @@ -905,6 +905,11 @@ func (s *Server) StartEventSource(es *events.EventSource, stream events.Eventing func (s *Server) shouldSendApplicationEvent(ae *appv1.ApplicationWatchEvent) bool { logCtx := log.WithField("application", ae.Application.Name) + if ae.Type == watch.Deleted { + logCtx.Info("application deleted") + return true + } + cachedApp, err := s.cache.GetLastApplicationEvent(&ae.Application) if err != nil || cachedApp == nil { return true