summaryrefslogtreecommitdiffhomepage
path: root/runsc/specutils
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-11-03 23:31:47 +0000
committergVisor bot <gvisor-bot@google.com>2020-11-03 23:31:47 +0000
commitf6a54ee4845a380062b945373ec597afffb27282 (patch)
treeb17420d083e6495b542daa49b1f854c7c907dc40 /runsc/specutils
parent25da68ce0722f5dc2c714a62bc047db4d40efd94 (diff)
parent1cfa8d58f6ffd7202fe445c2986f0366022d46f9 (diff)
Merge release-20201027.0-63-g1cfa8d58f (automated)
Diffstat (limited to 'runsc/specutils')
-rw-r--r--runsc/specutils/specutils.go3
1 files changed, 2 insertions, 1 deletions
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)