@@ -40,7 +40,7 @@ func NewDefaultRestarter() Restarter {
40
40
41
41
func (c defaultRestarter ) Restart () error {
42
42
// If listing systemd units succeeds, prefer systemctl restart; otherwise kill pid
43
- if _ , err := listSystemdUnits (); err == nil {
43
+ if _ , err := ListSystemdUnits (); err == nil {
44
44
out , err := nsenterCmd ("systemctl" , "restart" , "containerd" ).CombinedOutput ()
45
45
slog .Debug (string (out ))
46
46
if err != nil {
@@ -67,7 +67,7 @@ type K0sRestarter struct{}
67
67
func (c K0sRestarter ) Restart () error {
68
68
// First, collect systemd units to determine which mode k0s is running in, eg
69
69
// k0sworker or k0scontroller
70
- units , err := listSystemdUnits ()
70
+ units , err := ListSystemdUnits ()
71
71
if err != nil {
72
72
return fmt .Errorf ("unable to list systemd units: %w" , err )
73
73
}
@@ -88,7 +88,7 @@ func (c K3sRestarter) Restart() error {
88
88
// This restarter will be used both for stock K3s distros, which use systemd as well as K3d, which does not.
89
89
90
90
// If listing systemd units succeeds, prefer systemctl restart; otherwise kill pid
91
- if _ , err := listSystemdUnits (); err == nil {
91
+ if _ , err := ListSystemdUnits (); err == nil {
92
92
out , err := nsenterCmd ("systemctl" , "restart" , "k3s" ).CombinedOutput ()
93
93
slog .Debug (string (out ))
94
94
if err != nil {
@@ -130,7 +130,7 @@ type RKE2Restarter struct{}
130
130
func (c RKE2Restarter ) Restart () error {
131
131
// First, collect systemd units to determine which mode rke2 is running in, eg
132
132
// rke2-agent or rke2-server
133
- units , err := listSystemdUnits ()
133
+ units , err := ListSystemdUnits ()
134
134
if err != nil {
135
135
return fmt .Errorf ("unable to list systemd units: %w" , err )
136
136
}
@@ -145,7 +145,7 @@ func (c RKE2Restarter) Restart() error {
145
145
return nil
146
146
}
147
147
148
- func listSystemdUnits () ([]byte , error ) {
148
+ func ListSystemdUnits () ([]byte , error ) {
149
149
return nsenterCmd ("systemctl" , "list-units" , "--type" , "service" ).CombinedOutput ()
150
150
}
151
151
0 commit comments