copy containerd.UnknownExitStatus to local const

Copy this const to a local constant to prevent importing the containerd
client in the front-end.

For consistency, I also updated the executor code to use the same const,
although not strictly needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2020-11-18 00:11:09 +01:00
parent 264dfb0a53
commit 67bcfe699a
5 changed files with 14 additions and 7 deletions

View File

@@ -380,7 +380,7 @@ func (w *containerdExecutor) runProcess(ctx context.Context, p containerd.Proces
ExitCode: status.ExitCode(),
Err: status.Error(),
}
if status.ExitCode() == containerd.UnknownExitStatus && status.Error() != nil {
if status.ExitCode() == errdefs.ContainerdUnknownExitStatus && status.Error() != nil {
exitErr.Err = errors.Wrap(status.Error(), "failure waiting for process")
}
select {

View File

@@ -12,7 +12,6 @@ import (
"syscall"
"time"
"github.com/containerd/containerd"
"github.com/containerd/containerd/mount"
containerdoci "github.com/containerd/containerd/oci"
"github.com/containerd/continuity/fs"
@@ -335,7 +334,7 @@ func (w *runcExecutor) Run(ctx context.Context, id string, root executor.Mount,
func exitError(ctx context.Context, err error) error {
if err != nil {
exitErr := &errdefs.ExitError{
ExitCode: containerd.UnknownExitStatus,
ExitCode: errdefs.ContainerdUnknownExitStatus,
Err: err,
}
var runcExitError *runc.ExitError