1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #38545 from thaJeztah/integration_on_swarm_nits

no need to set exec.Env to os.Environ() as it's the default
This commit is contained in:
Yong Tang 2019-01-12 12:05:22 -08:00 committed by GitHub
commit e3c03d172e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,6 @@ func system(commands [][]string) error {
cmd := exec.Command(c[0], c[1:]...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Env = os.Environ()
if err := cmd.Run(); err != nil {
return err
}
@ -23,7 +22,7 @@ func system(commands [][]string) error {
return nil
}
func pushImage(unusedCli *client.Client, remote, local string) error {
func pushImage(_ *client.Client, remote, local string) error {
// FIXME: eliminate os/exec (but it is hard to pass auth without os/exec ...)
return system([][]string{
{"docker", "image", "tag", local, remote},
@ -31,7 +30,7 @@ func pushImage(unusedCli *client.Client, remote, local string) error {
})
}
func deployStack(unusedCli *client.Client, stackName, composeFilePath string) error {
func deployStack(_ *client.Client, stackName, composeFilePath string) error {
// FIXME: eliminate os/exec (but stack is implemented in CLI ...)
return system([][]string{
{"docker", "stack", "deploy",
@ -41,7 +40,7 @@ func deployStack(unusedCli *client.Client, stackName, composeFilePath string) er
})
}
func hasStack(unusedCli *client.Client, stackName string) bool {
func hasStack(_ *client.Client, stackName string) bool {
// FIXME: eliminate os/exec (but stack is implemented in CLI ...)
out, err := exec.Command("docker", "stack", "ls").CombinedOutput()
if err != nil {
@ -51,7 +50,7 @@ func hasStack(unusedCli *client.Client, stackName string) bool {
return strings.Contains(string(out), stackName)
}
func removeStack(unusedCli *client.Client, stackName string) error {
func removeStack(_ *client.Client, stackName string) error {
// FIXME: eliminate os/exec (but stack is implemented in CLI ...)
if err := system([][]string{
{"docker", "stack", "rm", stackName},