From 74f595fe6d59a6be9fa954c3c38a4bbcf7c60d95 Mon Sep 17 00:00:00 2001 From: Future-Outlier Date: Tue, 14 Jan 2025 00:51:40 +0800 Subject: [PATCH] fix Signed-off-by: Future-Outlier --- flytepropeller/pkg/controller/nodes/task/handler.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flytepropeller/pkg/controller/nodes/task/handler.go b/flytepropeller/pkg/controller/nodes/task/handler.go index b80641d03d..50a2a5f9a2 100644 --- a/flytepropeller/pkg/controller/nodes/task/handler.go +++ b/flytepropeller/pkg/controller/nodes/task/handler.go @@ -544,8 +544,6 @@ func (t Handler) invokePlugin(ctx context.Context, p pluginCore.Plugin, tCtx *ta // Regardless of the observed phase, we always add the DeckUri to support real-time deck functionality. // The deck should be accessible even if the task is still running or has failed. - // It's possible that the deck URI may not exist in remote storage yet or will never exist (likely from older Flytekit versions). - // So, it is console's responsibility to handle the case when the deck URI actually does not exist. deckStatus, err := GetDeckStatus(ctx, tCtx) if err != nil { return nil, err @@ -557,6 +555,9 @@ func (t Handler) invokePlugin(ctx context.Context, p pluginCore.Plugin, tCtx *ta switch pluginTrns.pInfo.Phase() { case pluginCore.PhaseSuccess: if deckStatus == DeckUnknown { + // This is for backward compatibility with older Flytekit versions. + // Older Flytekit versions did not set the `generates_deck` flag in the task template's metadata. + // So, we need to add deck URI to the event if it exists. err = pluginTrns.AddDeckURIIfDeckExists(ctx, tCtx) } if err != nil {