Skip to content

Commit

Permalink
Fix review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
shishir-a412ed committed Aug 24, 2020
1 parent e65c782 commit b69009e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"fmt"
"github.com/hashicorp/consul-template/signals"
"os"
"os/user"
"path/filepath"
"strings"
Expand Down Expand Up @@ -678,12 +677,11 @@ func (d *Driver) SignalTask(taskID string, signal string) error {
// The given signal will be forwarded to the target taskID.
// Please checkout https://github.com/hashicorp/consul-template/blob/master/signals/signals_unix.go
// for a list of supported signals.
sig := os.Interrupt
if s, ok := signals.SignalLookup[signal]; ok {
sig = s
} else {
d.logger.Warn("unknown signal to send to task, using SIGINT instead", "signal", signal, "task_id", handle.taskConfig.ID)
sig, ok := signals.SignalLookup[signal]
if !ok {
return fmt.Errorf("Error in looking up signal: %s", signal)
}

return d.podmanClient.SignalContainer(handle.containerID, sig)
}

Expand Down

0 comments on commit b69009e

Please sign in to comment.