mirror of
https://github.com/opencontainers/runc.git
synced 2026-11-06 05:17:05 +00:00
ci: bump golangci-lint to v2.15
Fix new errcheck warnings about unchecked errors received from channels: libcontainer/configs/config.go:632:3: Error return value is not checked (errcheck) libcontainer/logs/logs_linux_test.go:62:7: Error return value is not checked (errcheck) notify_socket_test.go:73:7: Error return value is not checked (errcheck) In the hook timeout case, the error from Wait is expected after Kill, so add a nolint annotation (using "_ =" upsets staticcheck's S1005). Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
1 parent
4115307e88
commit
3e06aff566
4 files changed
+8
-5
No files matched your search
@@ -54,7 +54,7 @@ jobs:
|
||||
sudo apt -qy install libseccomp-dev
|
||||
- uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
|
||||
with:
|
||||
version: v2.13
|
||||
version: v2.15
|
||||
skip-cache: true
|
||||
# Extra linters, only checking new code from a pull request to main.
|
||||
- name: lint-extra
|
||||
|
||||
@@ -629,7 +629,7 @@ func (c *Command) Run(s *specs.State) error {
|
||||
return err
|
||||
case <-timerCh:
|
||||
_ = cmd.Process.Kill()
|
||||
<-errC
|
||||
<-errC //nolint:errcheck // Wait error is expected after Kill.
|
||||
return fmt.Errorf("hook ran past specified timeout of %.1fs", c.Timeout.Seconds())
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,10 @@ func TestLogForwardingStopsAfterClosingTheWriter(t *testing.T) {
|
||||
// Do not use finish() here as we check done pipe ourselves.
|
||||
l.w.Close()
|
||||
select {
|
||||
case <-l.done:
|
||||
case err := <-l.done:
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
case <-time.After(10 * time.Second):
|
||||
t.Fatal("log forwarding did not stop after closing the pipe")
|
||||
}
|
||||
|
||||
@@ -70,8 +70,8 @@ func expectBarrier(t *testing.T, conn *net.UnixConn, notifyHostChan <-chan error
|
||||
case <-timer.C:
|
||||
// this is the expected case
|
||||
break
|
||||
case <-notifyHostChan:
|
||||
t.Fatal("runc has terminated before barrier was lifted")
|
||||
case err := <-notifyHostChan:
|
||||
t.Fatalf("runc has terminated before barrier was lifted (err: %v)", err)
|
||||
}
|
||||
|
||||
// Lift the barrier
|
||||
|
||||
Reference in new issue
Block a user