mirror of
https://github.com/siderolabs/talos.git
synced 2025-09-18 12:21:11 +02:00
chore: remove unused parameters
That context is not actually used. Discovered by new golangci-lint. Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
This commit is contained in:
parent
785161d19f
commit
e6f90bb41a
@ -100,7 +100,7 @@ type MockRunner struct {
|
|||||||
exitCh chan error
|
exitCh chan error
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MockRunner) Open(ctx context.Context) error {
|
func (m *MockRunner) Open() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ func NewRunner(debug bool, args *runner.Args, setters ...runner.Option) runner.R
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Open implements the Runner interface.
|
// Open implements the Runner interface.
|
||||||
func (c *containerdRunner) Open(ctx context.Context) error {
|
func (c *containerdRunner) Open() error {
|
||||||
// Create the containerd client.
|
// Create the containerd client.
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ func (suite *ContainerdSuite) SetupSuite() {
|
|||||||
runner.WithEnv([]string{"PATH=/bin:" + constants.PATH}),
|
runner.WithEnv([]string{"PATH=/bin:" + constants.PATH}),
|
||||||
runner.WithCgroupPath(suite.tmpDir),
|
runner.WithCgroupPath(suite.tmpDir),
|
||||||
)
|
)
|
||||||
suite.Require().NoError(suite.containerdRunner.Open(context.Background()))
|
suite.Require().NoError(suite.containerdRunner.Open())
|
||||||
suite.containerdWg.Add(1)
|
suite.containerdWg.Add(1)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
@ -174,7 +174,7 @@ func (suite *ContainerdSuite) TestRunSuccess() {
|
|||||||
runner.WithContainerdAddress(suite.containerdAddress),
|
runner.WithContainerdAddress(suite.containerdAddress),
|
||||||
)
|
)
|
||||||
|
|
||||||
suite.Require().NoError(r.Open(context.Background()))
|
suite.Require().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ func (suite *ContainerdSuite) TestRunTwice() {
|
|||||||
runner.WithContainerdAddress(suite.containerdAddress),
|
runner.WithContainerdAddress(suite.containerdAddress),
|
||||||
)
|
)
|
||||||
|
|
||||||
suite.Require().NoError(r.Open(context.Background()))
|
suite.Require().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ func (suite *ContainerdSuite) TestContainerCleanup() {
|
|||||||
runner.WithContainerdAddress(suite.containerdAddress),
|
runner.WithContainerdAddress(suite.containerdAddress),
|
||||||
)
|
)
|
||||||
|
|
||||||
suite.Require().NoError(r1.Open(context.Background()))
|
suite.Require().NoError(r1.Open())
|
||||||
|
|
||||||
r2 := containerdrunner.NewRunner(false, &runner.Args{
|
r2 := containerdrunner.NewRunner(false, &runner.Args{
|
||||||
ID: suite.containerID,
|
ID: suite.containerID,
|
||||||
@ -239,7 +239,7 @@ func (suite *ContainerdSuite) TestContainerCleanup() {
|
|||||||
runner.WithContainerImage(busyboxImage),
|
runner.WithContainerImage(busyboxImage),
|
||||||
runner.WithContainerdAddress(suite.containerdAddress),
|
runner.WithContainerdAddress(suite.containerdAddress),
|
||||||
)
|
)
|
||||||
suite.Require().NoError(r2.Open(context.Background()))
|
suite.Require().NoError(r2.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r2.Close()) }()
|
defer func() { suite.Assert().NoError(r2.Close()) }()
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ func (suite *ContainerdSuite) TestRunLogs() {
|
|||||||
runner.WithContainerdAddress(suite.containerdAddress),
|
runner.WithContainerdAddress(suite.containerdAddress),
|
||||||
)
|
)
|
||||||
|
|
||||||
suite.Require().NoError(r.Open(context.Background()))
|
suite.Require().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -303,7 +303,7 @@ func (suite *ContainerdSuite) TestStopFailingAndRestarting() {
|
|||||||
restart.WithRestartInterval(5*time.Millisecond),
|
restart.WithRestartInterval(5*time.Millisecond),
|
||||||
)
|
)
|
||||||
|
|
||||||
suite.Require().NoError(r.Open(context.Background()))
|
suite.Require().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -374,7 +374,7 @@ func (suite *ContainerdSuite) TestStopSigKill() {
|
|||||||
runner.WithContainerdAddress(suite.containerdAddress),
|
runner.WithContainerdAddress(suite.containerdAddress),
|
||||||
)
|
)
|
||||||
|
|
||||||
suite.Require().NoError(r.Open(context.Background()))
|
suite.Require().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -411,7 +411,7 @@ func (suite *ContainerdSuite) TestContainerStdin() {
|
|||||||
runner.WithContainerdAddress(suite.containerdAddress),
|
runner.WithContainerdAddress(suite.containerdAddress),
|
||||||
)
|
)
|
||||||
|
|
||||||
suite.Require().NoError(r.Open(context.Background()))
|
suite.Require().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ func NewRunner(r runtime.Runtime, id string, main FuncMain, setters ...runner.Op
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Open implements the Runner interface.
|
// Open implements the Runner interface.
|
||||||
func (r *goroutineRunner) Open(ctx context.Context) error {
|
func (r *goroutineRunner) Open() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ func (suite *GoroutineSuite) TestRunSuccess() {
|
|||||||
return nil
|
return nil
|
||||||
}, runner.WithLoggingManager(suite.loggingManager))
|
}, runner.WithLoggingManager(suite.loggingManager))
|
||||||
|
|
||||||
suite.Assert().NoError(r.Open(context.Background()))
|
suite.Assert().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ func (suite *GoroutineSuite) TestRunFail() {
|
|||||||
return errors.New("service failed")
|
return errors.New("service failed")
|
||||||
}, runner.WithLoggingManager(suite.loggingManager))
|
}, runner.WithLoggingManager(suite.loggingManager))
|
||||||
|
|
||||||
suite.Assert().NoError(r.Open(context.Background()))
|
suite.Assert().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ func (suite *GoroutineSuite) TestRunPanic() {
|
|||||||
panic("service panic")
|
panic("service panic")
|
||||||
}, runner.WithLoggingManager(suite.loggingManager))
|
}, runner.WithLoggingManager(suite.loggingManager))
|
||||||
|
|
||||||
suite.Assert().NoError(r.Open(context.Background()))
|
suite.Assert().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ func (suite *GoroutineSuite) TestStop() {
|
|||||||
return ctx.Err()
|
return ctx.Err()
|
||||||
}, runner.WithLoggingManager(suite.loggingManager))
|
}, runner.WithLoggingManager(suite.loggingManager))
|
||||||
|
|
||||||
suite.Assert().NoError(r.Open(context.Background()))
|
suite.Assert().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ func (suite *GoroutineSuite) TestRunLogs() {
|
|||||||
return nil
|
return nil
|
||||||
}, runner.WithLoggingManager(suite.loggingManager))
|
}, runner.WithLoggingManager(suite.loggingManager))
|
||||||
|
|
||||||
suite.Assert().NoError(r.Open(context.Background()))
|
suite.Assert().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
package process
|
package process
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
@ -52,7 +51,7 @@ func NewRunner(debug bool, args *runner.Args, setters ...runner.Option) runner.R
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Open implements the Runner interface.
|
// Open implements the Runner interface.
|
||||||
func (p *processRunner) Open(ctx context.Context) error {
|
func (p *processRunner) Open() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
package process_test
|
package process_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
@ -66,7 +65,7 @@ func (suite *ProcessSuite) TestRunSuccess() {
|
|||||||
ProcessArgs: []string{"/bin/sh", "-c", "exit 0"},
|
ProcessArgs: []string{"/bin/sh", "-c", "exit 0"},
|
||||||
}, runner.WithLoggingManager(suite.loggingManager))
|
}, runner.WithLoggingManager(suite.loggingManager))
|
||||||
|
|
||||||
suite.Assert().NoError(r.Open(context.Background()))
|
suite.Assert().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -81,7 +80,7 @@ func (suite *ProcessSuite) TestRunLogs() {
|
|||||||
ProcessArgs: []string{"/bin/sh", "-c", "echo -n \"Test 1\nTest 2\n\""},
|
ProcessArgs: []string{"/bin/sh", "-c", "echo -n \"Test 1\nTest 2\n\""},
|
||||||
}, runner.WithLoggingManager(suite.loggingManager))
|
}, runner.WithLoggingManager(suite.loggingManager))
|
||||||
|
|
||||||
suite.Assert().NoError(r.Open(context.Background()))
|
suite.Assert().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -109,7 +108,7 @@ func (suite *ProcessSuite) TestRunRestartFailed() {
|
|||||||
ProcessArgs: []string{"/bin/sh", "-c", "echo \"ran\"; test -f " + testFile},
|
ProcessArgs: []string{"/bin/sh", "-c", "echo \"ran\"; test -f " + testFile},
|
||||||
}, runner.WithLoggingManager(suite.loggingManager)), restart.WithType(restart.UntilSuccess), restart.WithRestartInterval(time.Millisecond))
|
}, runner.WithLoggingManager(suite.loggingManager)), restart.WithType(restart.UntilSuccess), restart.WithRestartInterval(time.Millisecond))
|
||||||
|
|
||||||
suite.Assert().NoError(r.Open(context.Background()))
|
suite.Assert().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -162,7 +161,7 @@ func (suite *ProcessSuite) TestStopFailingAndRestarting() {
|
|||||||
ProcessArgs: []string{"/bin/sh", "-c", "test -f " + testFile},
|
ProcessArgs: []string{"/bin/sh", "-c", "test -f " + testFile},
|
||||||
}, runner.WithLoggingManager(suite.loggingManager)), restart.WithType(restart.Forever), restart.WithRestartInterval(5*time.Millisecond))
|
}, runner.WithLoggingManager(suite.loggingManager)), restart.WithType(restart.Forever), restart.WithRestartInterval(5*time.Millisecond))
|
||||||
|
|
||||||
suite.Assert().NoError(r.Open(context.Background()))
|
suite.Assert().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -209,7 +208,7 @@ func (suite *ProcessSuite) TestStopSigKill() {
|
|||||||
runner.WithGracefulShutdownTimeout(10*time.Millisecond),
|
runner.WithGracefulShutdownTimeout(10*time.Millisecond),
|
||||||
)
|
)
|
||||||
|
|
||||||
suite.Assert().NoError(r.Open(context.Background()))
|
suite.Assert().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
package restart
|
package restart
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -96,8 +95,8 @@ func WithRestartInterval(interval time.Duration) Option {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Open implements the Runner interface.
|
// Open implements the Runner interface.
|
||||||
func (r *restarter) Open(ctx context.Context) error {
|
func (r *restarter) Open() error {
|
||||||
return r.wrappedRunner.Open(ctx)
|
return r.wrappedRunner.Open()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run implements the Runner interface
|
// Run implements the Runner interface
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
package restart_test
|
package restart_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
@ -29,7 +28,7 @@ type MockRunner struct {
|
|||||||
stopped chan struct{}
|
stopped chan struct{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MockRunner) Open(ctx context.Context) error {
|
func (m *MockRunner) Open() error {
|
||||||
m.stop = make(chan struct{})
|
m.stop = make(chan struct{})
|
||||||
m.stopped = make(chan struct{})
|
m.stopped = make(chan struct{})
|
||||||
|
|
||||||
@ -84,7 +83,7 @@ func (suite *RestartSuite) TestRunOnce() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
r := restart.New(&mock, restart.WithType(restart.Once))
|
r := restart.New(&mock, restart.WithType(restart.Once))
|
||||||
suite.Assert().NoError(r.Open(context.Background()))
|
suite.Assert().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -104,7 +103,7 @@ func (suite *RestartSuite) TestRunOnceStop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
r := restart.New(&mock, restart.WithType(restart.Once))
|
r := restart.New(&mock, restart.WithType(restart.Once))
|
||||||
suite.Assert().NoError(r.Open(context.Background()))
|
suite.Assert().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -124,7 +123,7 @@ func (suite *RestartSuite) TestRunUntilSuccess() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
r := restart.New(&mock, restart.WithType(restart.UntilSuccess), restart.WithRestartInterval(time.Millisecond))
|
r := restart.New(&mock, restart.WithType(restart.UntilSuccess), restart.WithRestartInterval(time.Millisecond))
|
||||||
suite.Assert().NoError(r.Open(context.Background()))
|
suite.Assert().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
@ -151,7 +150,7 @@ func (suite *RestartSuite) TestRunForever() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
r := restart.New(&mock, restart.WithType(restart.Forever), restart.WithRestartInterval(time.Millisecond))
|
r := restart.New(&mock, restart.WithType(restart.Forever), restart.WithRestartInterval(time.Millisecond))
|
||||||
suite.Assert().NoError(r.Open(context.Background()))
|
suite.Assert().NoError(r.Open())
|
||||||
|
|
||||||
defer func() { suite.Assert().NoError(r.Close()) }()
|
defer func() { suite.Assert().NoError(r.Close()) }()
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
package runner
|
package runner
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"time"
|
"time"
|
||||||
@ -22,7 +21,7 @@ import (
|
|||||||
// Runner describes the requirements for running a process.
|
// Runner describes the requirements for running a process.
|
||||||
type Runner interface {
|
type Runner interface {
|
||||||
fmt.Stringer
|
fmt.Stringer
|
||||||
Open(ctx context.Context) error
|
Open() error
|
||||||
Run(events.Recorder) error
|
Run(events.Recorder) error
|
||||||
Stop() error
|
Stop() error
|
||||||
Close() error
|
Close() error
|
||||||
|
@ -268,7 +268,7 @@ func (svcrunner *ServiceRunner) run(ctx context.Context, runnr runner.Runner) er
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := runnr.Open(ctx); err != nil {
|
if err := runnr.Open(); err != nil {
|
||||||
return fmt.Errorf("error opening runner: %w", err)
|
return fmt.Errorf("error opening runner: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ func (suite *ContainerdSuite) SetupSuite() {
|
|||||||
runner.WithEnv([]string{"PATH=/bin:" + constants.PATH}),
|
runner.WithEnv([]string{"PATH=/bin:" + constants.PATH}),
|
||||||
runner.WithCgroupPath(suite.tmpDir),
|
runner.WithCgroupPath(suite.tmpDir),
|
||||||
)
|
)
|
||||||
suite.Require().NoError(suite.containerdRunner.Open(context.Background()))
|
suite.Require().NoError(suite.containerdRunner.Open())
|
||||||
suite.containerdWg.Add(1)
|
suite.containerdWg.Add(1)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
@ -159,7 +159,7 @@ func (suite *ContainerdSuite) run(runners ...runner.Runner) {
|
|||||||
runningCh := make(chan bool, 2*len(runners))
|
runningCh := make(chan bool, 2*len(runners))
|
||||||
|
|
||||||
for _, r := range runners {
|
for _, r := range runners {
|
||||||
suite.Require().NoError(r.Open(context.Background()))
|
suite.Require().NoError(r.Open())
|
||||||
|
|
||||||
suite.containerRunners = append(suite.containerRunners, r)
|
suite.containerRunners = append(suite.containerRunners, r)
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ func (suite *CRISuite) SetupSuite() {
|
|||||||
runner.WithEnv([]string{"PATH=/bin:" + constants.PATH}),
|
runner.WithEnv([]string{"PATH=/bin:" + constants.PATH}),
|
||||||
runner.WithCgroupPath(suite.tmpDir),
|
runner.WithCgroupPath(suite.tmpDir),
|
||||||
)
|
)
|
||||||
suite.Require().NoError(suite.containerdRunner.Open(context.Background()))
|
suite.Require().NoError(suite.containerdRunner.Open())
|
||||||
suite.containerdWg.Add(1)
|
suite.containerdWg.Add(1)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
@ -107,7 +107,7 @@ func (suite *CRISuite) SetupSuite() {
|
|||||||
runner.WithEnv([]string{"PATH=/bin:" + constants.PATH}),
|
runner.WithEnv([]string{"PATH=/bin:" + constants.PATH}),
|
||||||
runner.WithCgroupPath(suite.tmpDir),
|
runner.WithCgroupPath(suite.tmpDir),
|
||||||
)
|
)
|
||||||
suite.Require().NoError(suite.containerdRunner.Open(context.Background()))
|
suite.Require().NoError(suite.containerdRunner.Open())
|
||||||
suite.containerdWg.Add(1)
|
suite.containerdWg.Add(1)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user