Skip to content

Handle empty DOCKER_BUILDKIT like unset#4216

Merged
thaJeztah merged 1 commit intodocker:masterfrom
vvoland:buildkit-empty
Apr 19, 2023
Merged

Handle empty DOCKER_BUILDKIT like unset#4216
thaJeztah merged 1 commit intodocker:masterfrom
vvoland:buildkit-empty

Conversation

@vvoland
Copy link
Copy Markdown
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>
@vvoland vvoland added this to the 24.0.0 milestone Apr 19, 2023
@vvoland vvoland requested review from crazy-max and thaJeztah April 19, 2023 13:12
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 19, 2023

Codecov Report

Merging #4216 (ff7f76a) into master (3bc814e) will not change coverage.
The diff coverage is 60.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4216   +/-   ##
=======================================
  Coverage   58.86%   58.86%           
=======================================
  Files         572      572           
  Lines       49544    49544           
=======================================
  Hits        29162    29162           
  Misses      18616    18616           
  Partials     1766     1766           

Copy link
Copy Markdown
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
Copy link
Copy Markdown
Member

@crazy-max pal

@thaJeztah
Copy link
Copy Markdown
Member

@vvoland can you open a cherry-pick as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants