Merge pull request #985 from samuelkarp/task-delete-nil-check
containerd: nil-check before calling io.Close
This commit is contained in:
commit
beaff3d81d
5
task.go
5
task.go
@ -156,7 +156,10 @@ func (t *task) Wait(ctx context.Context) (uint32, error) {
|
|||||||
// it returns the exit status of the task and any errors that were encountered
|
// it returns the exit status of the task and any errors that were encountered
|
||||||
// during cleanup
|
// during cleanup
|
||||||
func (t *task) Delete(ctx context.Context) (uint32, error) {
|
func (t *task) Delete(ctx context.Context) (uint32, error) {
|
||||||
cerr := t.io.Close()
|
var cerr error
|
||||||
|
if t.io != nil {
|
||||||
|
cerr = t.io.Close()
|
||||||
|
}
|
||||||
r, err := t.client.TaskService().Delete(ctx, &execution.DeleteRequest{
|
r, err := t.client.TaskService().Delete(ctx, &execution.DeleteRequest{
|
||||||
ContainerID: t.containerID,
|
ContainerID: t.containerID,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user