diff options
author | Ting-Yu Wang <anivia@google.com> | 2020-11-03 15:21:38 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-11-03 15:23:32 -0800 |
commit | 1cfa8d58f6ffd7202fe445c2986f0366022d46f9 (patch) | |
tree | 2619c494296a36e308b375fc01e7e5bf856073f4 /runsc | |
parent | 580bbb749747e8c8bbf4dfe60c15676c85065a6a (diff) |
Fix more nogo tests
PiperOrigin-RevId: 340536306
Diffstat (limited to 'runsc')
-rw-r--r-- | runsc/cmd/checkpoint.go | 3 | ||||
-rw-r--r-- | runsc/config/flags.go | 2 | ||||
-rw-r--r-- | runsc/specutils/specutils.go | 3 |
3 files changed, 6 insertions, 2 deletions
diff --git a/runsc/cmd/checkpoint.go b/runsc/cmd/checkpoint.go index 8fe0c427a..d4e0da2ab 100644 --- a/runsc/cmd/checkpoint.go +++ b/runsc/cmd/checkpoint.go @@ -149,6 +149,9 @@ func (c *Checkpoint) Execute(_ context.Context, f *flag.FlagSet, args ...interfa } ws, err := cont.Wait() + if err != nil { + Fatalf("Error waiting for container: %v", err) + } *waitStatus = ws return subcommands.ExitSuccess diff --git a/runsc/config/flags.go b/runsc/config/flags.go index d3203b565..13d8f1b25 100644 --- a/runsc/config/flags.go +++ b/runsc/config/flags.go @@ -29,7 +29,7 @@ import ( var registration sync.Once -// This is the set of flags used to populate Config. +// RegisterFlags registers flags used to populate Config. func RegisterFlags() { registration.Do(func() { // Although these flags are not part of the OCI spec, they are used by diff --git a/runsc/specutils/specutils.go b/runsc/specutils/specutils.go index 45abc1425..7b923ddf4 100644 --- a/runsc/specutils/specutils.go +++ b/runsc/specutils/specutils.go @@ -19,6 +19,7 @@ package specutils import ( "encoding/json" "fmt" + "io" "io/ioutil" "os" "path" @@ -169,7 +170,7 @@ func ReadSpec(bundleDir string, conf *config.Config) (*specs.Spec, error) { // ReadSpecFromFile reads an OCI runtime spec from the given File, and // normalizes all relative paths into absolute by prepending the bundle dir. func ReadSpecFromFile(bundleDir string, specFile *os.File, conf *config.Config) (*specs.Spec, error) { - if _, err := specFile.Seek(0, os.SEEK_SET); err != nil { + if _, err := specFile.Seek(0, io.SeekStart); err != nil { return nil, fmt.Errorf("error seeking to beginning of file %q: %v", specFile.Name(), err) } specBytes, err := ioutil.ReadAll(specFile) |