Skip to content

Commit

Permalink
Wait for cache to sync (#2517)
Browse files Browse the repository at this point in the history
Signed-off-by: Nikhil <nikhil1.raghav@gmail.com>

Signed-off-by: Nikhil <nikhil1.raghav@gmail.com>
  • Loading branch information
nikhil1raghav authored and zachaller committed Feb 24, 2023
1 parent 23b3b1f commit d024327
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit d024327

Please sign in to comment.