diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index d961bae22f..5e425dbe01 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -204,7 +204,9 @@ func NewOperator() (context.Context, *Operator) { lo.Must0(mgr.GetFieldIndexer().IndexField(ctx, &storagev1.VolumeAttachment{}, "spec.nodeName", func(o client.Object) []string { return []string{o.(*storagev1.VolumeAttachment).Spec.NodeName} }), "failed to setup volumeattachment indexer") - + lo.Must0(mgr.AddReadyzCheck("manager", func(req *http.Request) error { + return lo.Ternary(mgr.GetCache().WaitForCacheSync(req.Context()), nil, fmt.Errorf("failed to sync caches")) + })) lo.Must0(mgr.AddHealthzCheck("healthz", healthz.Ping)) lo.Must0(mgr.AddReadyzCheck("readyz", healthz.Ping))