Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
abort then finalize
Browse files Browse the repository at this point in the history
  • Loading branch information
migueltol22 committed Apr 24, 2020
1 parent 5f5d1a9 commit ad4ce20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
5 changes: 3 additions & 2 deletions go/tasks/plugins/array/k8s/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ func TerminateSubTasks(ctx context.Context, tCtx core.TaskExecutionContext, kube
Config: config,
State: currentState,
}
err := task.Finalize(ctx, tCtx, kubeClient)

err := task.Abort(ctx, tCtx, kubeClient)
if err != nil {
errs.Collect(childIdx, err.Error())
}
err = task.Abort(ctx, tCtx, kubeClient)
err = task.Finalize(ctx, tCtx, kubeClient)
if err != nil {
errs.Collect(childIdx, err.Error())
}
Expand Down
7 changes: 0 additions & 7 deletions go/tasks/plugins/array/k8s/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,6 @@ func (t Task) Abort(ctx context.Context, tCtx core.TaskExecutionContext, kubeCli
return err
}

// Deallocate Resource
err = deallocateResource(ctx, tCtx, t.Config, t.ChildIdx)
if err != nil {
logger.Errorf(ctx, "Error releasing allocation token [%s] in Finalize [%s]", podName, err)
return err
}

return nil

}
Expand Down

0 comments on commit ad4ce20

Please sign in to comment.