summaryrefslogtreecommitdiffhomepage
path: root/pkg/shim/proc
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2021-06-29 10:53:10 -0700
committergVisor bot <gvisor-bot@google.com>2021-06-29 10:56:17 -0700
commit5f2b3728fc1d71d32912c57d948ba4b15c886f2a (patch)
tree1697b8bf8238bf3dc3b795b9eec01d9a777a882e /pkg/shim/proc
parent5b2afd24a7ed6d626ede2d06d04378f95c3b62f8 (diff)
Redirect all calls from `errdefs.ToGRPC` to `utils.ErrToGRPC`
This is to ensure that Go 1.13 error wrapping is correctly translated to gRPC errors before returning from the shim. Updates #6225 PiperOrigin-RevId: 382120441
Diffstat (limited to 'pkg/shim/proc')
-rw-r--r--pkg/shim/proc/BUILD1
-rw-r--r--pkg/shim/proc/init_state.go3
2 files changed, 3 insertions, 1 deletions
diff --git a/pkg/shim/proc/BUILD b/pkg/shim/proc/BUILD
index 544bdc170..dd64344b3 100644
--- a/pkg/shim/proc/BUILD
+++ b/pkg/shim/proc/BUILD
@@ -21,6 +21,7 @@ go_library(
],
deps = [
"//pkg/shim/runsc",
+ "//pkg/shim/utils",
"@com_github_containerd_console//:go_default_library",
"@com_github_containerd_containerd//errdefs:go_default_library",
"@com_github_containerd_containerd//log:go_default_library",
diff --git a/pkg/shim/proc/init_state.go b/pkg/shim/proc/init_state.go
index d65020e76..5347ddefe 100644
--- a/pkg/shim/proc/init_state.go
+++ b/pkg/shim/proc/init_state.go
@@ -23,6 +23,7 @@ import (
"github.com/containerd/containerd/pkg/process"
runc "github.com/containerd/go-runc"
"golang.org/x/sys/unix"
+ "gvisor.dev/gvisor/pkg/shim/utils"
)
type stateTransition int
@@ -235,6 +236,6 @@ func handleStoppedKill(signal uint32) error {
// already been killed.
return nil
default:
- return errdefs.ToGRPCf(errdefs.ErrNotFound, "process not found")
+ return utils.ErrToGRPCf(errdefs.ErrNotFound, "process not found")
}
}