Skip to content

Commit c5fc9bd

Browse files
committed
Fix runtime not filled in yet
1 parent cf4e38f commit c5fc9bd

File tree

1 file changed

+12
-0
lines changed
  • components/node-labeler/cmd

1 file changed

+12
-0
lines changed

components/node-labeler/cmd/run.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,21 @@ func workspaceFilter() predicate.Predicate {
284284
return predicate.Funcs{
285285
CreateFunc: func(e event.CreateEvent) bool {
286286
ws := e.Object.(*workspacev1.Workspace)
287+
if ws.Status.Runtime == nil {
288+
log.WithField("workspace", ws.Name).Info("workspace not ready yet")
289+
return false
290+
}
291+
287292
return ws.Status.Runtime != nil && ws.Status.Runtime.NodeName != ""
288293
},
289294
UpdateFunc: func(e event.UpdateEvent) bool {
295+
wsOld := e.ObjectOld.(*workspacev1.Workspace)
296+
ws := e.ObjectNew.(*workspacev1.Workspace)
297+
if wsOld.Status.Runtime == nil && ws.Status.Runtime != nil {
298+
return true
299+
}
300+
301+
// if we've seen runtime info before, there's no need to reconcile again
290302
return false
291303
},
292304
DeleteFunc: func(e event.DeleteEvent) bool {

0 commit comments

Comments
 (0)