summaryrefslogtreecommitdiffhomepage
path: root/pkg/shim/v1/proc/exec_state.go
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-05-05 22:00:14 -0700
committerAdin Scannell <ascannell@google.com>2020-07-09 17:39:47 -0700
commit2afff44403e046078301de39f0252bb57fc018c7 (patch)
treef944f66ffaab8f10029b451755bcb20a3ff40269 /pkg/shim/v1/proc/exec_state.go
parent2f24ab339736315659f26699ab50aa2982d7e890 (diff)
Update shim to build using bazel.
The go.mod dependency tree for the shim was somehow contradictory. After resolving these issues (e.g. explicitly imported k8s 1.14, pulling a specific dbus version), and adding all dependencies, the shim can now be build as part of the regular bazel tree. As part of this process, minor cleanup was done in all the source files: headers were standardized (and include "The gVisor Authors" in addition to the "The containerd Authors" if originally derived from containerd sources), and comments were cleaned up to meet coding standards. This change makes the containerd installation dynamic, so that multiple versions can be tested, and drops the static installer for the VM image itself. This change also updates test/root/crictl_test.go and related utilities, so that the containerd tests can be run on any version (and in cases where it applies, they can be run on both v1 and v2 as parameterized tests).
Diffstat (limited to 'pkg/shim/v1/proc/exec_state.go')
-rw-r--r--pkg/shim/v1/proc/exec_state.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/pkg/shim/v1/proc/exec_state.go b/pkg/shim/v1/proc/exec_state.go
index 5416cb601..4dcda8b44 100644
--- a/pkg/shim/v1/proc/exec_state.go
+++ b/pkg/shim/v1/proc/exec_state.go
@@ -17,9 +17,9 @@ package proc
import (
"context"
+ "fmt"
"github.com/containerd/console"
- "github.com/pkg/errors"
)
type execState interface {
@@ -43,7 +43,7 @@ func (s *execCreatedState) transition(name string) error {
case "deleted":
s.p.execState = &deletedState{}
default:
- return errors.Errorf("invalid state transition %q to %q", stateName(s), name)
+ return fmt.Errorf("invalid state transition %q to %q", stateName(s), name)
}
return nil
}
@@ -87,7 +87,7 @@ func (s *execRunningState) transition(name string) error {
case "stopped":
s.p.execState = &execStoppedState{p: s.p}
default:
- return errors.Errorf("invalid state transition %q to %q", stateName(s), name)
+ return fmt.Errorf("invalid state transition %q to %q", stateName(s), name)
}
return nil
}
@@ -97,11 +97,11 @@ func (s *execRunningState) Resize(ws console.WinSize) error {
}
func (s *execRunningState) Start(ctx context.Context) error {
- return errors.Errorf("cannot start a running process")
+ return fmt.Errorf("cannot start a running process")
}
func (s *execRunningState) Delete(ctx context.Context) error {
- return errors.Errorf("cannot delete a running process")
+ return fmt.Errorf("cannot delete a running process")
}
func (s *execRunningState) Kill(ctx context.Context, sig uint32, all bool) error {
@@ -125,17 +125,17 @@ func (s *execStoppedState) transition(name string) error {
case "deleted":
s.p.execState = &deletedState{}
default:
- return errors.Errorf("invalid state transition %q to %q", stateName(s), name)
+ return fmt.Errorf("invalid state transition %q to %q", stateName(s), name)
}
return nil
}
func (s *execStoppedState) Resize(ws console.WinSize) error {
- return errors.Errorf("cannot resize a stopped container")
+ return fmt.Errorf("cannot resize a stopped container")
}
func (s *execStoppedState) Start(ctx context.Context) error {
- return errors.Errorf("cannot start a stopped process")
+ return fmt.Errorf("cannot start a stopped process")
}
func (s *execStoppedState) Delete(ctx context.Context) error {