From add7e8acb93a90235b257727d6c98d6d9ab6f504 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Sun, 15 Apr 2018 22:08:40 -0700 Subject: [PATCH] Stop sending boot commands when context canceled. --- common/boot_command/boot_command_ast.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/boot_command/boot_command_ast.go b/common/boot_command/boot_command_ast.go index fceb8c51b..16b562e95 100644 --- a/common/boot_command/boot_command_ast.go +++ b/common/boot_command/boot_command_ast.go @@ -50,6 +50,9 @@ type expressionSequence []expression // Do executes every expression in the sequence and then finalizes the driver. func (s expressionSequence) Do(ctx context.Context, b BCDriver) error { for _, exp := range s { + if err := ctx.Err(); err != nil { + return err + } if err := exp.Do(ctx, b); err != nil { return err }