@@ -92,10 +92,14 @@ func (k *Klocksmith) process(stop <-chan struct{}) error {
9292 constants .AnnotationRebootInProgress : constants .False ,
9393 constants .AnnotationRebootNeeded : constants .False ,
9494 }
95+ labels := map [string ]string {
96+ constants .LabelRebootNeeded : constants .False ,
97+ }
9598 glog .Infof ("Setting annotations %#v" , anno )
96- if err := k8sutil .SetNodeAnnotations (k .nc , k .node , anno ); err != nil {
99+ if err := k8sutil .SetNodeAnnotationsLabels (k .nc , k .node , anno , labels ); err != nil {
97100 return err
98101 }
102+
99103 // Since we set 'reboot-needed=false', 'ok-to-reboot' should clear.
100104 // Wait for it to do so, else we might start reboot-looping
101105 if err := k .waitForNotOkToReboot (); err != nil {
@@ -199,14 +203,17 @@ func (k *Klocksmith) updateStatusCallback(s updateengine.Status) {
199203 constants .AnnotationNewVersion : s .NewVersion ,
200204 }
201205
206+ labels := map [string ]string {}
207+
202208 // indicate we need a reboot
203209 if s .CurrentOperation == updateengine .UpdateStatusUpdatedNeedReboot {
204210 glog .Info ("Indicating a reboot is needed" )
205211 anno [constants .AnnotationRebootNeeded ] = constants .True
212+ labels [constants .LabelRebootNeeded ] = constants .True
206213 }
207214
208215 wait .PollUntil (defaultPollInterval , func () (bool , error ) {
209- if err := k8sutil .SetNodeAnnotations (k .nc , k .node , anno ); err != nil {
216+ if err := k8sutil .SetNodeAnnotationsLabels (k .nc , k .node , anno , labels ); err != nil {
210217 glog .Errorf ("Failed to set annotation %q: %v" , constants .AnnotationStatus , err )
211218 return false , nil
212219 }
0 commit comments