Merge pull request #11621 from k8s-infra-cherrypick-robot/cherry-pick-11475-to-release/2.0

[release/2.0] fix: call checkCopyShimLogError(shimCtx) to avoid expected error log flood
This commit is contained in:
Fu Wei 2025-03-28 19:12:21 -04:00 committed by GitHub
commit 9e97c2e626
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -91,9 +91,9 @@ func loadShim(ctx context.Context, bundle *Bundle, onClose func()) (_ ShimInstan
// To prevent flood of error messages, the expected error
// should be reset, like os.ErrClosed or os.ErrNotExist, which
// depends on platform.
err = checkCopyShimLogError(ctx, err)
err = checkCopyShimLogError(shimCtx, err)
if err != nil {
log.G(ctx).WithError(err).Error("copy shim log after reload")
log.G(shimCtx).WithError(err).Error("copy shim log after reload")
}
}()
onCloseWithShimLog := func() {