summaryrefslogtreecommitdiffhomepage
path: root/pkg/shim/v1/proc/init_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/init_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/init_state.go')
-rw-r--r--pkg/shim/v1/proc/init_state.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/pkg/shim/v1/proc/init_state.go b/pkg/shim/v1/proc/init_state.go
index 868646b6c..509f27762 100644
--- a/pkg/shim/v1/proc/init_state.go
+++ b/pkg/shim/v1/proc/init_state.go
@@ -17,11 +17,11 @@ package proc
import (
"context"
+ "fmt"
"github.com/containerd/console"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/runtime/proc"
- "github.com/pkg/errors"
)
type initState interface {
@@ -46,7 +46,7 @@ func (s *createdState) transition(name string) error {
case "deleted":
s.p.initState = &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
}
@@ -107,7 +107,7 @@ func (s *runningState) transition(name string) error {
case "stopped":
s.p.initState = &stoppedState{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
}
@@ -117,11 +117,11 @@ func (s *runningState) Resize(ws console.WinSize) error {
}
func (s *runningState) Start(ctx context.Context) error {
- return errors.Errorf("cannot start a running process")
+ return fmt.Errorf("cannot start a running process")
}
func (s *runningState) Delete(ctx context.Context) error {
- return errors.Errorf("cannot delete a running process")
+ return fmt.Errorf("cannot delete a running process")
}
func (s *runningState) Kill(ctx context.Context, sig uint32, all bool) error {
@@ -149,17 +149,17 @@ func (s *stoppedState) transition(name string) error {
case "deleted":
s.p.initState = &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 *stoppedState) Resize(ws console.WinSize) error {
- return errors.Errorf("cannot resize a stopped container")
+ return fmt.Errorf("cannot resize a stopped container")
}
func (s *stoppedState) Start(ctx context.Context) error {
- return errors.Errorf("cannot start a stopped process")
+ return fmt.Errorf("cannot start a stopped process")
}
func (s *stoppedState) Delete(ctx context.Context) error {
@@ -178,5 +178,5 @@ func (s *stoppedState) SetExited(status int) {
}
func (s *stoppedState) Exec(ctx context.Context, path string, r *ExecConfig) (proc.Process, error) {
- return nil, errors.Errorf("cannot exec in a stopped state")
+ return nil, fmt.Errorf("cannot exec in a stopped state")
}