Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli/config: improve error when failing to parse config file #5567

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

thaJeztah
Copy link
Member

The format had a stray colon and space included. While fixing that, also updating the error message to clarify the error happened while parsing the file (not so much "loading" it).

Before:

WARNING: Error loading config file: /root/.docker/config.json: : json: cannot unmarshal bool into Go struct field ConfigFile.features of type string

After:

WARNING: Error parsing config file (/root/.docker/config.json): json: cannot unmarshal bool into Go struct field ConfigFile.features of type string

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

@thaJeztah thaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Oct 21, 2024
@thaJeztah thaJeztah added this to the 28.0.0 milestone Oct 21, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.59%. Comparing base (062eecf) to head (d96f8b7).
Report is 27 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5567      +/-   ##
==========================================
+ Coverage   59.57%   59.59%   +0.02%     
==========================================
  Files         345      345              
  Lines       29088    29096       +8     
==========================================
+ Hits        17330    17341      +11     
+ Misses      10788    10784       -4     
- Partials      970      971       +1     

The format had a stray colon and space included. While fixing that, also
updating the error message to clarify the error happened while parsing
the file (not so much "loading" it).

Before:

    WARNING: Error loading config file: /root/.docker/config.json: : json: cannot unmarshal bool into Go struct field ConfigFile.features of type string

After:

    WARNING: Error parsing config file (/root/.docker/config.json): json: cannot unmarshal bool into Go struct field ConfigFile.features of type string

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah merged commit c34b80b into docker:master Oct 22, 2024
89 checks passed
@thaJeztah thaJeztah deleted the config_fix_err branch October 22, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactor PR's that refactor, or clean-up code status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants