Skip to content

Commit 0b96646

Browse files
committed
Fixed a bug that caused incorrect validation for DOCKER_COMMAND
1 parent 629d05d commit 0b96646

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

internal/cmd/diagnose.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,14 @@ func (d *diagnoser) checkCommandEnv() {
5656
}
5757

5858
exePath, err := os.Executable()
59-
if err != nil && value != exePath {
59+
if err == nil && value != exePath {
6060
d.reportBad(`Environment variable DOCKER_COMMAND has a wrong value.
61-
The actual value is '%s', but the full path of the current executable is '%s'
62-
`,
61+
The actual value is '%s', but the full path of the current executable is '%s'`,
6362
value, exePath)
6463
return
6564
}
6665

67-
d.reportGood("Environment variable DOCKER_COMMAND has a valid value.")
66+
d.reportGood("Environment variable DOCKER_COMMAND has a valid value: '%s'", value)
6867
}
6968

7069
func (d *diagnoser) checkHostEnv() (string, bool) {
@@ -87,7 +86,7 @@ A valid example is '%s' if the daemon is listening on the IP address and the por
8786
return host, false
8887
}
8988

90-
d.reportGood("Environment variable DOCKER_HOST has a valid value.")
89+
d.reportGood("Environment variable DOCKER_HOST has a valid value: '%s'", host)
9190
return host, true
9291
}
9392

0 commit comments

Comments
 (0)