From 6d551e0a5a2a9f07d6946c38ee197aa923a40fb7 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 5 Mar 2025 11:36:55 +0100 Subject: [PATCH] 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 --- cli/command/cli.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/command/cli.go b/cli/command/cli.go index 3cf576b112..1b5eca5963 100644 --- a/cli/command/cli.go +++ b/cli/command/cli.go @@ -194,16 +194,16 @@ func (cli *DockerCli) BuildKitEnabled() (bool, error) { // HooksEnabled returns whether plugin hooks are enabled. func (cli *DockerCli) HooksEnabled() bool { - // legacy support DOCKER_CLI_HINTS env var - if v := os.Getenv("DOCKER_CLI_HINTS"); v != "" { + // use DOCKER_CLI_HOOKS env var value if set and not empty + if v := os.Getenv("DOCKER_CLI_HOOKS"); v != "" { enabled, err := strconv.ParseBool(v) if err != nil { return false } return enabled } - // use DOCKER_CLI_HOOKS env var value if set and not empty - if v := os.Getenv("DOCKER_CLI_HOOKS"); v != "" { + // legacy support DOCKER_CLI_HINTS env var + if v := os.Getenv("DOCKER_CLI_HINTS"); v != "" { enabled, err := strconv.ParseBool(v) if err != nil { return false