From 67d0755982791ceabf6820a34c7bd7abad8ac911 Mon Sep 17 00:00:00 2001 From: SataQiu Date: Mon, 6 Sep 2021 12:10:44 +0800 Subject: [PATCH] bugfix: fix incomplete data copy of resource filter Signed-off-by: SataQiu --- pkg/yurthub/cachemanager/cache_manager.go | 2 +- pkg/yurthub/filter/filter.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/yurthub/cachemanager/cache_manager.go b/pkg/yurthub/cachemanager/cache_manager.go index 1dee13d0a19..0a4193c661e 100644 --- a/pkg/yurthub/cachemanager/cache_manager.go +++ b/pkg/yurthub/cachemanager/cache_manager.go @@ -347,7 +347,7 @@ func (cm *cacheManager) saveListObject(ctx context.Context, info *apirequest.Req list, err := s.Decode(b) if err != nil || list == nil { - klog.Errorf("failed to decode response in saveOneObject %v", err) + klog.Errorf("failed to decode response in saveListObject %v", err) return err } diff --git a/pkg/yurthub/filter/filter.go b/pkg/yurthub/filter/filter.go index 22402fc6af8..a5f991edc63 100644 --- a/pkg/yurthub/filter/filter.go +++ b/pkg/yurthub/filter/filter.go @@ -191,8 +191,7 @@ func (dr *filterReadCloser) Read(p []byte) (int, error) { return n, nil } } else { - n := copy(p, dr.data.Bytes()) - return n, io.EOF + return dr.data.Read(p) } }