From 3241005fc0e417af0a9bbd09526ed4cdb650ebd4 Mon Sep 17 00:00:00 2001 From: nexustar Date: Fri, 27 Aug 2021 19:00:05 +0800 Subject: [PATCH] fix error handle in UpdateComponentManifests() (#1536) --- pkg/repository/v1_repository.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/repository/v1_repository.go b/pkg/repository/v1_repository.go index 42ea9e17b6..e0f9f60107 100644 --- a/pkg/repository/v1_repository.go +++ b/pkg/repository/v1_repository.go @@ -708,17 +708,15 @@ func (r *V1Repository) UpdateComponentManifests() error { for name := range index.Components { name := name g.Go(func() error { - _, err = r.updateComponentManifest(name, false) + _, err := r.updateComponentManifest(name, false) + if err != nil && errors.Cause(err) == ErrUnknownComponent { + err = nil + } return err }) } - err = g.Wait() - if err != nil && errors.Cause(err) != ErrUnknownComponent { - return err - } - - return nil + return err } // FetchComponentManifest fetch the component manifest.