diff --git a/pkg/stores/proxyalpha/proxy_store.go b/pkg/stores/proxyalpha/proxy_store.go index 5a06ef6e..1841b2fe 100644 --- a/pkg/stores/proxyalpha/proxy_store.go +++ b/pkg/stores/proxyalpha/proxy_store.go @@ -423,6 +423,7 @@ func (s *Store) WatchNames(apiOp *types.APIRequest, schema *types.APISchema, w t } else { logrus.Debugf("WatchNames received error: %v", item) } + result <- item continue } diff --git a/pkg/stores/proxyalpha/proxy_store_test.go b/pkg/stores/proxyalpha/proxy_store_test.go index 062a7bee..3d637e7a 100644 --- a/pkg/stores/proxyalpha/proxy_store_test.go +++ b/pkg/stores/proxyalpha/proxy_store_test.go @@ -5,6 +5,7 @@ import ( "fmt" "net/http" "net/url" + "strings" "testing" "time" @@ -682,6 +683,7 @@ func receiveUntil(wc chan watch.Event, d time.Duration) error { timer := time.NewTicker(d) defer timer.Stop() secretNames := []string{"testsecret1", "testsecret2"} + errMsgs := []string{"err1", "err2", "err3"} for { select { case event, ok := <-wc: @@ -690,7 +692,13 @@ func receiveUntil(wc chan watch.Event, d time.Duration) error { } if event.Type == watch.Error { - return errors.New(fmt.Sprintf("watch chan should not have sent events of type [%s]", watch.Error)) + status, ok := event.Object.(*metav1.Status) + if !ok { + continue + } + if strings.HasSuffix(status.Message, errMsgs[0]) { + errMsgs = errMsgs[1:] + } } secret, ok := event.Object.(*v1.Secret) if !ok { @@ -699,7 +707,7 @@ func receiveUntil(wc chan watch.Event, d time.Duration) error { if secret.Name == secretNames[0] { secretNames = secretNames[1:] } - if len(secretNames) == 0 { + if len(secretNames) == 0 && len(errMsgs) == 0 { return nil } continue