testutil/daemon: remove redundant fmt.Sprintf()'s
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
67b4b032f3
commit
7e06add3c8
|
@ -3,7 +3,6 @@ package daemon // import "github.com/docker/docker/testutil/daemon"
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
@ -102,7 +101,7 @@ func NewDaemon(workingDir string, ops ...Option) (*Daemon, error) {
|
||||||
return nil, errors.Wrapf(err, "failed to create daemon socket root %q", SockRoot)
|
return nil, errors.Wrapf(err, "failed to create daemon socket root %q", SockRoot)
|
||||||
}
|
}
|
||||||
|
|
||||||
id := fmt.Sprintf("d%s", stringid.TruncateID(stringid.GenerateRandomID()))
|
id := "d" + stringid.TruncateID(stringid.GenerateRandomID())
|
||||||
dir := filepath.Join(workingDir, id)
|
dir := filepath.Join(workingDir, id)
|
||||||
daemonFolder, err := filepath.Abs(dir)
|
daemonFolder, err := filepath.Abs(dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -248,7 +247,7 @@ func (d *Daemon) StorageDriver() string {
|
||||||
|
|
||||||
// Sock returns the socket path of the daemon
|
// Sock returns the socket path of the daemon
|
||||||
func (d *Daemon) Sock() string {
|
func (d *Daemon) Sock() string {
|
||||||
return fmt.Sprintf("unix://" + d.sockPath())
|
return "unix://" + d.sockPath()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Daemon) sockPath() string {
|
func (d *Daemon) sockPath() string {
|
||||||
|
@ -347,7 +346,7 @@ func (d *Daemon) StartWithLogFile(out *os.File, providedArgs ...string) error {
|
||||||
"--data-root", d.Root,
|
"--data-root", d.Root,
|
||||||
"--exec-root", d.execRoot,
|
"--exec-root", d.execRoot,
|
||||||
"--pidfile", d.pidFile,
|
"--pidfile", d.pidFile,
|
||||||
fmt.Sprintf("--userland-proxy=%t", d.userlandProxy),
|
"--userland-proxy="+strconv.FormatBool(d.userlandProxy),
|
||||||
"--containerd-namespace", d.id,
|
"--containerd-namespace", d.id,
|
||||||
"--containerd-plugins-namespace", d.id+"p",
|
"--containerd-plugins-namespace", d.id+"p",
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue