Skip to content

Conversation

vvoland
Copy link
Collaborator

@vvoland vvoland commented Apr 19, 2023

This fixes the cli erroring out if the variable is set to an empty value.
The behavior for empty variable will be the same as if it was undefined.

$ export DOCKER_BUILDKIT=
$ docker version
DOCKER_BUILDKIT environment variable expects boolean value: strconv.ParseBool: parsing "": invalid syntax

- What I did

- How I did it
Use os.Getenv instead of os.LookupEnv

- How to verify it

DOCKER_BUILDKIT= docker version

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

This fixes the cli erroring out if the variable is set to an empty
value.

```
$ export DOCKER_BUILDKIT=
$ docker version
DOCKER_BUILDKIT environment variable expects boolean value: strconv.ParseBool: parsing "": invalid syntax
```

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit ff7f76a)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland added area/builder kind/bugfix PR's that fix bugs labels Apr 19, 2023
@vvoland vvoland added this to the 23.0.5 milestone Apr 19, 2023
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit ced769f into docker:23.0 Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/builder kind/bugfix PR's that fix bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants