Skip to content

Commit 6d551e0

Browse files
committed
cli/command: DockerCli.HooksEnabled check current before legacy
The DOCKER_CLI_HINTS env-var is replaced by DOCKER_CLI_HOOKS; check the new env-var first, and only fall back to checking the legacy env-var if it's not set. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent a2d7807 commit 6d551e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cli/command/cli.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,16 @@ func (cli *DockerCli) BuildKitEnabled() (bool, error) {
194194

195195
// HooksEnabled returns whether plugin hooks are enabled.
196196
func (cli *DockerCli) HooksEnabled() bool {
197-
// legacy support DOCKER_CLI_HINTS env var
198-
if v := os.Getenv("DOCKER_CLI_HINTS"); v != "" {
197+
// use DOCKER_CLI_HOOKS env var value if set and not empty
198+
if v := os.Getenv("DOCKER_CLI_HOOKS"); v != "" {
199199
enabled, err := strconv.ParseBool(v)
200200
if err != nil {
201201
return false
202202
}
203203
return enabled
204204
}
205-
// use DOCKER_CLI_HOOKS env var value if set and not empty
206-
if v := os.Getenv("DOCKER_CLI_HOOKS"); v != "" {
205+
// legacy support DOCKER_CLI_HINTS env var
206+
if v := os.Getenv("DOCKER_CLI_HINTS"); v != "" {
207207
enabled, err := strconv.ParseBool(v)
208208
if err != nil {
209209
return false

0 commit comments

Comments
 (0)