Skip to content

Commit

Permalink
Drop the depends on github.com/docker/docker
Browse files Browse the repository at this point in the history
The exit code of os/exec.Command is easy to get, no need to
import docker's system package.
  • Loading branch information
zhsj committed Oct 24, 2020
1 parent b536fb6 commit ba41537
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Expand Up @@ -79,6 +79,7 @@
- Sasha Yakovtseva <sasha@sylabs.io>, <sashayakovtseva@gmail.com>
- Satish Chebrolu <satish@sylabs.io>
- Shane Loretz <sloretz@openrobotics.org>, <shane.loretz@gmail.com>
- Shengjing Zhu <i@zhsj.me>
- Tarcisio Fedrizzi <tarcisio.fedrizzi@gmail.com>
- Thomas Hamel <hmlth@t-hamel.fr>
- Tru Huynh <tru@pasteur.fr>
Expand Down
1 change: 0 additions & 1 deletion go.mod
Expand Up @@ -17,7 +17,6 @@ require (
github.com/containernetworking/plugins v0.8.7
github.com/containers/image/v5 v5.6.0
github.com/deislabs/oras v0.8.1
github.com/docker/docker v1.4.2-0.20200203170920-46ec8731fbce
github.com/dsnet/compress v0.0.1 // indirect
github.com/fatih/color v1.9.0
github.com/garyburd/redigo v1.6.0 // indirect
Expand Down
3 changes: 1 addition & 2 deletions internal/pkg/build/sources/conveyorPacker_zypper.go
Expand Up @@ -20,7 +20,6 @@ import (
"strings"
"syscall"

"github.com/docker/docker/pkg/system"
"github.com/sylabs/singularity/pkg/build/types"
"github.com/sylabs/singularity/pkg/sylog"
)
Expand Down Expand Up @@ -324,7 +323,7 @@ func (cp *ZypperConveyorPacker) Get(ctx context.Context, b *types.Bundle) (err e

// run zypper
if err = cmd.Run(); err != nil {
if ret, _ := system.GetExitCode(err); ret == 107 {
if exitError, ok := err.(*exec.ExitError); ok && exitError.ExitCode() == 107 {
sylog.Warningf("Bootstrap succeeded, some RPM scripts failed")
} else {
return fmt.Errorf("while bootstrapping from zypper: %v", err)
Expand Down

0 comments on commit ba41537

Please sign in to comment.