Skip to content

Commit

Permalink
Remove Deck URI in when OutputReader is nil (#6223)
Browse files Browse the repository at this point in the history
* Remove Deck URI in agent task

Signed-off-by: Future-Outlier <[email protected]>

* update

Signed-off-by: Future-Outlier <[email protected]>

* update

Signed-off-by: Future-Outlier <[email protected]>

---------

Signed-off-by: Future-Outlier <[email protected]>
  • Loading branch information
Future-Outlier authored Feb 6, 2025
1 parent ea00864 commit 7dfe7d4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions flytepropeller/pkg/controller/nodes/task/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,24 @@ func (p *pluginRequestedTransition) AddDeckURI(tCtx *taskExecutionContext) {
}

func (p *pluginRequestedTransition) RemoveDeckURIIfDeckNotExists(ctx context.Context, tCtx *taskExecutionContext) error {
// If there's no output info, nothing to do.
if p.execInfo.OutputInfo == nil {
return nil
}

reader := tCtx.ow.GetReader()
if reader == nil {
p.execInfo.OutputInfo.DeckURI = nil
return nil
}

exists, err := reader.DeckExists(ctx)
if err != nil {
if p.execInfo.OutputInfo != nil {
p.execInfo.OutputInfo.DeckURI = nil
}
p.execInfo.OutputInfo.DeckURI = nil
return regErrors.Wrapf(err, "failed to check existence of deck file")
}

if !exists && p.execInfo.OutputInfo != nil {
if !exists {
p.execInfo.OutputInfo.DeckURI = nil
}

Expand Down

0 comments on commit 7dfe7d4

Please sign in to comment.