From 0414d4acf5cdea4d3cf40f52498cab358c7c3921 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Tue, 10 Aug 2021 10:43:34 -0700 Subject: [PATCH] If the user doesn't specify a resourceVersion default to "" not latest --- pkg/stores/proxy/proxy_store.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/pkg/stores/proxy/proxy_store.go b/pkg/stores/proxy/proxy_store.go index 8be0bb3..80e8aa5 100644 --- a/pkg/stores/proxy/proxy_store.go +++ b/pkg/stores/proxy/proxy_store.go @@ -282,21 +282,8 @@ func returnErr(err error, c chan types.APIEvent) { func (s *Store) listAndWatch(apiOp *types.APIRequest, k8sClient dynamic.ResourceInterface, schema *types.APISchema, w types.WatchRequest, result chan types.APIEvent) { rev := w.Revision - if rev == "-1" { + if rev == "-1" || rev == "0" { rev = "" - } else { - // ensure the revision is valid or get the latest one - list, err := k8sClient.List(apiOp.Context(), metav1.ListOptions{ - Limit: 1, - ResourceVersion: rev, - }) - if err != nil { - returnErr(errors.Wrapf(err, "failed to list %s", schema.ID), result) - return - } - if rev == "" { - rev = list.GetResourceVersion() - } } timeout := int64(60 * 30)