Skip to content

Commit 1d18265

Browse files
update
Signed-off-by: Future-Outlier <eric901201@gmail.com>
1 parent 0b91b5c commit 1d18265

File tree

1 file changed

+12
-7
lines changed
  • flytepropeller/pkg/controller/nodes/task

1 file changed

+12
-7
lines changed

flytepropeller/pkg/controller/nodes/task/handler.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -427,15 +427,20 @@ func (t Handler) fetchPluginTaskMetrics(pluginID, taskType string) (*taskMetrics
427427
func GetDeckStatus(ctx context.Context, tCtx *taskExecutionContext) (DeckStatus, error) {
428428
// GetDeckStatus determines whether a task generates a deck based on its execution context.
429429
//
430-
// This function evaluates the `generates_deck` flag in the task template's metadata to determine the deck status:
431-
// 1. If `generates_deck` is set to true, it indicates that the task generates a deck, and DeckEnabled is returned.
432-
// 2. If `generates_deck` is set to false, it indicates that the task does not generate a deck, and DeckDisabled is returned.
433-
// 3. If `generates_deck` is nil (likely from older Flytekit versions), DeckUnknown is returned as a placeholder status.
430+
// This function evaluates the current condition of the task to determine the deck status:
431+
//
432+
// | Condition Description | Has Deck |
433+
// |--------------------------------|----------|
434+
// | Enabled and Running | Yes |
435+
// | Unknown State with Deck | Yes |
436+
// | Unknown State without Deck | No |
437+
// | Enabled and Succeeded | Yes |
438+
// | Enabled but Memory Exceeded | No |
439+
// | Disabled | No |
434440
//
435441
// The lifecycle of deck generation is as follows:
436-
// - During task execution, the `generates_deck` flag is checked to determine if a deck should be generated.
437-
// - In terminal states, if the status is DeckUnknown, a HEAD request can be made to verify the existence of the deck file.
438-
442+
// - During task execution, the condition is checked to determine if a deck should be generated.
443+
// - In terminal states, if the status is DeckUnknown or DeckEnabled, a HEAD request can be made to verify the existence of the deck file.
439444
template, err := tCtx.tr.Read(ctx)
440445
if err != nil {
441446
return DeckUnknown, regErrors.Wrapf(err, "failed to read task template")

0 commit comments

Comments
 (0)