diff --git a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go index 7f558a58866b5..f1b9d695321ad 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go @@ -769,6 +769,10 @@ func (s *store) List(ctx context.Context, key string, opts storage.ListOptions, // indicate to the client which resource version was returned if returnedRV == 0 { returnedRV = getResp.Header.Revision + // if returnedRV was not set previously then WithRev option was not either, so set here in case + // hasMore is true and we do a subsequent Get. If we don't set this the next Get may give + // back inconsistent data because we are Get-ing the latest data and not at a specific revision + options = append(options, clientv3.WithRev(returnedRV)) } // no more results remain or we didn't request paging