mirror of https://github.com/docker/docs.git
Merge pull request #19715 from coolljt0725/fix_test_daemon
Test utils: fix daemon start utils
This commit is contained in:
commit
fc8e344297
|
@ -224,17 +224,20 @@ func (d *Daemon) Start(arg ...string) error {
|
||||||
|
|
||||||
// If we don't explicitly set the log-level or debug flag(-D) then
|
// If we don't explicitly set the log-level or debug flag(-D) then
|
||||||
// turn on debug mode
|
// turn on debug mode
|
||||||
foundIt := false
|
foundLog := false
|
||||||
|
foundSd := false
|
||||||
for _, a := range arg {
|
for _, a := range arg {
|
||||||
if strings.Contains(a, "--log-level") || strings.Contains(a, "-D") || strings.Contains(a, "--debug") {
|
if strings.Contains(a, "--log-level") || strings.Contains(a, "-D") || strings.Contains(a, "--debug") {
|
||||||
foundIt = true
|
foundLog = true
|
||||||
|
}
|
||||||
|
if strings.Contains(a, "--storage-driver") {
|
||||||
|
foundSd = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !foundIt {
|
if !foundLog {
|
||||||
args = append(args, "--debug")
|
args = append(args, "--debug")
|
||||||
}
|
}
|
||||||
|
if d.storageDriver != "" && !foundSd {
|
||||||
if d.storageDriver != "" {
|
|
||||||
args = append(args, "--storage-driver", d.storageDriver)
|
args = append(args, "--storage-driver", d.storageDriver)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue