Skip to content

Commit

Permalink
plugin: check errors
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
  • Loading branch information
runcom committed Feb 15, 2017
1 parent 40dbbd3 commit 3716dd2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugin/backend_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ func (pm *Manager) Upgrade(ctx context.Context, ref reference.Named, name string
name = reference.FamiliarString(reference.TagNameOnly(nameref))

tmpRootFSDir, err := ioutil.TempDir(pm.tmpDir(), ".rootfs")
if err != nil {
return err
}
defer os.RemoveAll(tmpRootFSDir)

dm := &downloadManager{
Expand Down Expand Up @@ -289,6 +292,9 @@ func (pm *Manager) Pull(ctx context.Context, ref reference.Named, name string, m
}

tmpRootFSDir, err := ioutil.TempDir(pm.tmpDir(), ".rootfs")
if err != nil {
return err
}
defer os.RemoveAll(tmpRootFSDir)

dm := &downloadManager{
Expand Down Expand Up @@ -679,10 +685,11 @@ func (pm *Manager) CreateFromContext(ctx context.Context, tarCtx io.ReadCloser,
}

tmpRootFSDir, err := ioutil.TempDir(pm.tmpDir(), ".rootfs")
defer os.RemoveAll(tmpRootFSDir)
if err != nil {
return errors.Wrap(err, "failed to create temp directory")
}
defer os.RemoveAll(tmpRootFSDir)

var configJSON []byte
rootFS := splitConfigRootFSFromTar(tarCtx, &configJSON)

Expand Down

0 comments on commit 3716dd2

Please sign in to comment.