Skip to content

Commit 1247a4d

Browse files
Update pkg/cache/internal/informers.go
Co-authored-by: Stefan Büringer <[email protected]>
1 parent 15d6f1d commit 1247a4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/cache/internal/informers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ func (ip *Informers) Get(ctx context.Context, gvk schema.GroupVersionKind, obj r
271271
shouldBlock = *cfg.BlockUntilSynced
272272
}
273273

274-
if started && !i.Informer.HasSynced() && shouldBlock {
274+
if shouldBlock && started && !i.Informer.HasSynced() {
275275
// Wait for it to sync before returning the Informer so that folks don't read from a stale cache.
276276
if !cache.WaitForCacheSync(ctx.Done(), i.Informer.HasSynced) {
277277
return started, nil, apierrors.NewTimeoutError(fmt.Sprintf("failed waiting for %T Informer to sync", obj), 0)

0 commit comments

Comments
 (0)