Skip to content

Commit ac74e4f

Browse files
Error out on invalid signal.
1 parent 418cd4a commit ac74e4f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

containerd/driver.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ package containerd
2020
import (
2121
"context"
2222
"fmt"
23-
"os"
2423
"syscall"
2524
"time"
2625

@@ -583,13 +582,11 @@ func (d *Driver) SignalTask(taskID string, signal string) error {
583582
// The given signal will be forwarded to the target taskID.
584583
// Please checkout https://github.com/hashicorp/consul-template/blob/master/signals/signals_unix.go
585584
// for a list of supported signals.
586-
sig := os.Interrupt
587-
if s, ok := signals.SignalLookup[signal]; ok {
588-
sig = s
589-
} else {
590-
d.logger.Warn("unknown signal to send to task, using SIGINT instead", "signal", signal, "task_id", handle.taskConfig.ID)
591-
585+
sig, ok := signals.SignalLookup[signal]
586+
if !ok {
587+
return fmt.Errorf("Invalid signal: %s", signal)
592588
}
589+
593590
return handle.signal(d.ctxContainerd, sig)
594591
}
595592

0 commit comments

Comments
 (0)