Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/controller/modeladapter/modeladapter_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ func newReconciler(mgr manager.Manager, runtimeConfig config.RuntimeConfig) (rec
return nil, err
}

klog.Info("Waiting for caches to sync")
if ok := cacher.WaitForCacheSync(context.TODO()); !ok {
return nil, errors.New("modeladapter controller: failed to sync cache")
}
klog.Info("All caches synced")

// Let's generate the clientset and use ModelAdapterLister here as well.
podLister := corelisters.NewPodLister(podInformer.(toolscache.SharedIndexInformer).GetIndexer())
serviceLister := corelisters.NewServiceLister(serviceInformer.(toolscache.SharedIndexInformer).GetIndexer())
Expand Down
7 changes: 7 additions & 0 deletions pkg/controller/modelrouter/modelrouter_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package modelrouter

import (
"context"
"errors"
"fmt"
"strconv"

Expand Down Expand Up @@ -105,6 +106,12 @@ func Add(mgr manager.Manager, runtimeConfig config.RuntimeConfig) error {
DeleteFunc: modelRouter.deleteRouteFromRayClusterFleet,
})

klog.Info("Waiting for caches to sync")
if ok := cacher.WaitForCacheSync(context.TODO()); !ok {
return errors.New("modelrouter controller: failed to sync cache")
}
klog.Info("All caches synced")

return err
}

Expand Down