@@ -40,7 +40,7 @@ func NewDefaultRestarter() Restarter {
4040
4141func (c defaultRestarter ) Restart () error {
4242 // If listing systemd units succeeds, prefer systemctl restart; otherwise kill pid
43- if _ , err := listSystemdUnits (); err == nil {
43+ if _ , err := ListSystemdUnits (); err == nil {
4444 out , err := nsenterCmd ("systemctl" , "restart" , "containerd" ).CombinedOutput ()
4545 slog .Debug (string (out ))
4646 if err != nil {
@@ -67,7 +67,7 @@ type K0sRestarter struct{}
6767func (c K0sRestarter ) Restart () error {
6868 // First, collect systemd units to determine which mode k0s is running in, eg
6969 // k0sworker or k0scontroller
70- units , err := listSystemdUnits ()
70+ units , err := ListSystemdUnits ()
7171 if err != nil {
7272 return fmt .Errorf ("unable to list systemd units: %w" , err )
7373 }
@@ -88,7 +88,7 @@ func (c K3sRestarter) Restart() error {
8888 // This restarter will be used both for stock K3s distros, which use systemd as well as K3d, which does not.
8989
9090 // If listing systemd units succeeds, prefer systemctl restart; otherwise kill pid
91- if _ , err := listSystemdUnits (); err == nil {
91+ if _ , err := ListSystemdUnits (); err == nil {
9292 out , err := nsenterCmd ("systemctl" , "restart" , "k3s" ).CombinedOutput ()
9393 slog .Debug (string (out ))
9494 if err != nil {
@@ -130,7 +130,7 @@ type RKE2Restarter struct{}
130130func (c RKE2Restarter ) Restart () error {
131131 // First, collect systemd units to determine which mode rke2 is running in, eg
132132 // rke2-agent or rke2-server
133- units , err := listSystemdUnits ()
133+ units , err := ListSystemdUnits ()
134134 if err != nil {
135135 return fmt .Errorf ("unable to list systemd units: %w" , err )
136136 }
@@ -145,7 +145,7 @@ func (c RKE2Restarter) Restart() error {
145145 return nil
146146}
147147
148- func listSystemdUnits () ([]byte , error ) {
148+ func ListSystemdUnits () ([]byte , error ) {
149149 return nsenterCmd ("systemctl" , "list-units" , "--type" , "service" ).CombinedOutput ()
150150}
151151
0 commit comments