Skip to content

config: refuse to save a config file that failed to load - #7475

Open
locker95 wants to merge 1 commit into
docker:masterfrom
locker95:fix-invalid-config-no-clobber
Open

locker95 wants to merge 1 commit into
docker:masterfrom
locker95:fix-invalid-config-no-clobber

Conversation

@locker95

@locker95 locker95 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Malformed config.json was only a warning, so the next docker login or docker context use replaced it with a mostly empty file.

Save now leaves that file alone if we couldn't read it. Commands that only read the config still warn and continue.

Fixes #5075

A malformed config.json was only a warning. The next login or
context change rewrote it with an empty config.

Fixes docker#5075

Signed-off-by: Dean Chen <862469039@qq.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/config/configfile/file.go 0.00% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker should fail if config file is invalid

2 participants