Skip to content

Commit

Permalink
add task metadata runtime flavor error handling
Browse files Browse the repository at this point in the history
Signed-off-by: Future Outlier <eric901201@gmai.com>
  • Loading branch information
Future Outlier committed Nov 9, 2023
1 parent 6750c31 commit c5bcd99
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,14 @@ func (c CorePlugin) Handle(ctx context.Context, tCtx core.TaskExecutionContext)
}

// Use the sync plugin to execute the task if the task template has the sync plugin flavor.
if taskTemplate.GetMetadata().GetRuntime().GetFlavor() == syncPlugin {
return c.syncHandle(ctx, tCtx)
metadata := taskTemplate.GetMetadata()
if metadata != nil {
runtime := metadata.GetRuntime()
if runtime != nil {
if runtime.GetFlavor() == syncPlugin {
return c.syncHandle(ctx, tCtx)
}
}
}

incomingState, err := c.unmarshalState(ctx, tCtx.PluginStateReader())
Expand Down

0 comments on commit c5bcd99

Please sign in to comment.