Skip to content

Commit cff832c

Browse files
committed
ref(node-installer): rm unused Env param from Restarter
Signed-off-by: Vaughn Dice <[email protected]>
1 parent 899d70f commit cff832c

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

cmd/node-installer/install.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,12 @@ var installCmd = &cobra.Command{
4545
}
4646

4747
config.Runtime.ConfigPath = distro.ConfigPath
48-
env := preset.Env{ConfigPath: distro.ConfigPath, HostFs: hostFs}
49-
50-
if err = distro.Setup(env); err != nil {
48+
if err = distro.Setup(preset.Env{ConfigPath: distro.ConfigPath, HostFs: hostFs}); err != nil {
5149
slog.Error("failed to run distro setup", "error", err)
5250
os.Exit(1)
5351
}
5452

55-
if err := RunInstall(config, rootFs, hostFs, distro.Restarter(env)); err != nil {
53+
if err := RunInstall(config, rootFs, hostFs, distro.Restarter()); err != nil {
5654
slog.Error("failed to install", "error", err)
5755
os.Exit(1)
5856
}

cmd/node-installer/uninstall.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
"github.com/spf13/cobra"
2727

2828
"github.com/spinkube/runtime-class-manager/internal/containerd"
29-
"github.com/spinkube/runtime-class-manager/internal/preset"
3029
"github.com/spinkube/runtime-class-manager/internal/shim"
3130
)
3231

@@ -46,7 +45,7 @@ var uninstallCmd = &cobra.Command{
4645

4746
config.Runtime.ConfigPath = distro.ConfigPath
4847

49-
if err := RunUninstall(config, rootFs, hostFs, distro.Restarter(preset.Env{ConfigPath: distro.ConfigPath, HostFs: hostFs})); err != nil {
48+
if err := RunUninstall(config, rootFs, hostFs, distro.Restarter()); err != nil {
5049
slog.Error("failed to uninstall", "error", err)
5150
os.Exit(1)
5251
}

internal/preset/preset.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
type Settings struct {
1414
ConfigPath string
1515
Setup func(Env) error
16-
Restarter func(Env) containerd.Restarter
16+
Restarter func() containerd.Restarter
1717
}
1818

1919
type Env struct {
@@ -24,7 +24,7 @@ type Env struct {
2424
var Default = Settings{
2525
ConfigPath: "/etc/containerd/config.toml",
2626
Setup: func(_ Env) error { return nil },
27-
Restarter: func(_ Env) containerd.Restarter { return containerd.NewRestarter() },
27+
Restarter: func() containerd.Restarter { return containerd.NewRestarter() },
2828
}
2929

3030
func (s Settings) WithConfigPath(path string) Settings {

0 commit comments

Comments
 (0)