This repository was archived by the owner on Sep 18, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package agent
22
33import (
4- "context"
54 "fmt"
65 "time"
76
@@ -227,28 +226,6 @@ func (k *Klocksmith) watchUpdateStatus(update func(s updateengine.Status), stop
227226 }
228227}
229228
230- // waitForRebootSignal watches update_engine and waits for
231- // updateengine.UpdateStatusUpdatedNeedReboot
232- func (k * Klocksmith ) waitForRebootSignal () error {
233- // first, check current status.
234- status , err := k .ue .GetStatus ()
235- if err != nil {
236- return fmt .Errorf ("failed to get update_engine status: %v" , err )
237- }
238-
239- // if we're not in UpdateStatusUpdatedNeedReboot, then wait for it.
240- if status .CurrentOperation != updateengine .UpdateStatusUpdatedNeedReboot {
241- ctx , cancel := context .WithCancel (context .Background ())
242- stc := make (chan updateengine.Status )
243- go k .ue .RebootNeededSignal (stc , ctx .Done ())
244- <- stc
245- cancel ()
246- }
247-
248- // we are now in UpdateStatusUpdatedNeedReboot state.
249- return nil
250- }
251-
252229// waitForOkToReboot waits for both 'ok-to-reboot' and 'needs-reboot' to be true.
253230func (k * Klocksmith ) waitForOkToReboot () error {
254231 n , err := k .nc .Get (k .node , v1meta.GetOptions {})
You can’t perform that action at this time.
0 commit comments