From d024327ab62cce17e2aaadfab3f09814836c26c4 Mon Sep 17 00:00:00 2001 From: nikhil1raghav <44281594+nikhil1raghav@users.noreply.github.com> Date: Mon, 16 Jan 2023 20:42:24 +0530 Subject: [PATCH] Wait for cache to sync (#2517) Signed-off-by: Nikhil Signed-off-by: Nikhil --- server/server.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/server.go b/server/server.go index a69d90d5f0..cbb742333d 100644 --- a/server/server.go +++ b/server/server.go @@ -372,6 +372,7 @@ func (s *ArgoRolloutsServer) AbortRollout(ctx context.Context, q *rollout.AbortR func (s *ArgoRolloutsServer) getRollout(namespace string, name string) (*v1alpha1.Rollout, error) { rolloutsInformerFactory := rolloutinformers.NewSharedInformerFactoryWithOptions(s.Options.RolloutsClientset, 0, rolloutinformers.WithNamespace(namespace)) + cache.WaitForCacheSync(s.stopCh, rolloutsInformerFactory.Argoproj().V1alpha1().Rollouts().Informer().HasSynced) rolloutsLister := rolloutsInformerFactory.Argoproj().V1alpha1().Rollouts().Lister().Rollouts(namespace) return rolloutsLister.Get(name) }