Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions runner/cmd/runner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ func start(tempDir string, homeDir string, httpPort int, sshPort int, logLevel i
return fmt.Errorf("create default log file: %w", err)
}
defer func() {
err = defaultLogFile.Close()
if err != nil {
log.Error(context.TODO(), "Failed to close default log file", "err", err)
closeErr := defaultLogFile.Close()
if closeErr != nil {
log.Error(context.TODO(), "Failed to close default log file", "err", closeErr)
}
}()

Expand Down
4 changes: 2 additions & 2 deletions runner/internal/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ func (ex *RunExecutor) execJob(ctx context.Context, jobLogFile io.Writer) error
cmd := exec.CommandContext(ctx, ex.jobSpec.Commands[0], ex.jobSpec.Commands[1:]...)
cmd.Cancel = func() error {
// returns error on Windows
if err = cmd.Process.Signal(os.Interrupt); err != nil {
return fmt.Errorf("send interrupt signal: %w", err)
if signalErr := cmd.Process.Signal(os.Interrupt); signalErr != nil {
return fmt.Errorf("send interrupt signal: %w", signalErr)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion runner/internal/shim/host_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type hostInfo struct {
func WriteHostInfo(dir string, resources Resources) error {
path := filepath.Join(dir, "host_info.json")
// if host_info.json already exists, do nothing and return os.ErrExist
if _, err := os.Stat(path); errors.Is(err, os.ErrExist) {
if _, err := os.Stat(path); !errors.Is(err, os.ErrNotExist) {
return err
}

Expand Down