From 5f62b0cd4ad03053bcb8a65e6cc0219c5c88b16d Mon Sep 17 00:00:00 2001 From: sealos-ci-robot <109538726+sealos-ci-robot@users.noreply.github.com> Date: Wed, 23 Aug 2023 16:03:55 +0800 Subject: [PATCH] fix: ignore signal killed when context cancelled (#3748) (#3749) Co-authored-by: fengxsong --- pkg/filesystem/registry/sync.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/filesystem/registry/sync.go b/pkg/filesystem/registry/sync.go index bf43e6a32b3..138ba23e351 100644 --- a/pkg/filesystem/registry/sync.go +++ b/pkg/filesystem/registry/sync.go @@ -75,7 +75,10 @@ func (s *impl) Sync(ctx context.Context, hosts ...string) error { go func(ctx context.Context, host string) { logger.Debug("running temporary registry on host %s", host) if err := s.ssh.CmdAsyncWithContext(ctx, host, getRegistryServeCommand(s.pathResolver, defaultTemporaryPort)); err != nil { - logger.Error(err) + // ignore expected signal killed error when context cancel + if !strings.Contains(err.Error(), "signal: killed") { + logger.Error(err) + } } }(cmdCtx, hosts[i]) }