Skip to content

Commit 8688fe0

Browse files
committed
ref(node-installer): simplify Restarter to be containerd.Restarter type
Signed-off-by: Vaughn Dice <[email protected]>
1 parent f33e400 commit 8688fe0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cmd/node-installer/install.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var installCmd = &cobra.Command{
5050
os.Exit(1)
5151
}
5252

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

cmd/node-installer/uninstall.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ var uninstallCmd = &cobra.Command{
4545

4646
config.Runtime.ConfigPath = distro.ConfigPath
4747

48-
if err := RunUninstall(config, rootFs, hostFs, distro.Restarter()); err != nil {
48+
if err := RunUninstall(config, rootFs, hostFs, distro.Restarter); err != nil {
4949
slog.Error("failed to uninstall", "error", err)
5050
os.Exit(1)
5151
}

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() containerd.Restarter
16+
Restarter 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() containerd.Restarter { return containerd.NewRestarter() },
27+
Restarter: containerd.NewRestarter(),
2828
}
2929

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

0 commit comments

Comments
 (0)