From 840c098e0481e810c4a0aab505f757d1ea1eb137 Mon Sep 17 00:00:00 2001 From: Babis Kiosidis Date: Mon, 25 Jul 2022 15:33:17 +0300 Subject: [PATCH] remove terminated wfs' blob obj from cache Signed-off-by: Babis Kiosidis --- pkg/controller/handler.go | 4 ++++ pkg/controller/staticobjstore/factory.go | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) delete mode 100644 pkg/controller/staticobjstore/factory.go diff --git a/pkg/controller/handler.go b/pkg/controller/handler.go index 4f88c3fb5..33a2b033b 100644 --- a/pkg/controller/handler.go +++ b/pkg/controller/handler.go @@ -190,6 +190,10 @@ func (p *Propeller) Handle(ctx context.Context, namespace, name string) error { if w.GetExecutionStatus().IsTerminated() { if HasCompletedLabel(w) && !HasFinalizer(w) { + // clear blobs from cache for terminated workflows + if w.WorkflowStaticExecutionObj != "" { + p.staticObjStore.Remove(ctx, w) + } logger.Debugf(ctx, "Workflow is terminated.") // This workflow had previously completed, let us ignore it return nil diff --git a/pkg/controller/staticobjstore/factory.go b/pkg/controller/staticobjstore/factory.go deleted file mode 100644 index 12942a461..000000000 --- a/pkg/controller/staticobjstore/factory.go +++ /dev/null @@ -1 +0,0 @@ -package staticobjstore