Skip to content

configfile: keep unknown JSON keys when saving config.json - #7319

Open
locker95 wants to merge 1 commit into
docker:masterfrom
locker95:fix/config-preserve-unknown
Open

locker95 wants to merge 1 commit into
docker:masterfrom
locker95:fix/config-preserve-unknown

Conversation

@locker95

Copy link
Copy Markdown
Contributor

login / logout / context use rewrite config.json from the struct, so any key this CLI version does not know about gets dropped. experimental is the one that bit me on an older build; same thing will happen for fields added later.

Keep those keys around on load and write them back on save. Known fields still win if both are present.

Fixes #5559

login, logout, and context use rewrite the whole file from the
struct, so keys this CLI version does not know about (experimental
on older builds, or anything added later) get dropped.

Remember those keys on load and write them back on save.

Fixes docker#5559

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

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/config/configfile/file.go 71.42% 6 Missing and 6 partials ⚠️

📢 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.

saving configuration file is not forward-compatible

2 participants