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/command/context: fix error-handling of skip-tls-verify #5850

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Feb 20, 2025

Before 2b9a4d5, this function would use "errors.Wrap" which returns nil if the original error was nil. fmt.Errorf does not do this, so without a nil check, it would unconditionally return an error;

docker context create arm64 --docker host=ssh://172.17.101.26,skip-tls-verify=False

unable to create docker endpoint config: name: %!w(<nil>)

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

Fix `docker context create` always returning an error when using the  "skip-tls-verify" option.

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

Verified

This commit was signed with the committer’s verified signature.
thaJeztah Sebastiaan van Stijn
Before 2b9a4d5, this function
would use "errors.Wrap" which returns nil if the original error
was nil. fmt.Errorf does not do this, so without a nil check,
it would unconditionally return an error;

    docker context create arm64 --docker host=ssh://172.17.101.26,skip-tls-verify=False

    unable to create docker endpoint config: name: %!w(<nil>)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2025

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 58.88%. Comparing base (f9ced58) to head (7e71782).
Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5850      +/-   ##
==========================================
+ Coverage   58.81%   58.88%   +0.07%     
==========================================
  Files         349      349              
  Lines       29556    29562       +6     
==========================================
+ Hits        17382    17409      +27     
+ Misses      11189    11171      -18     
+ Partials      985      982       -3     

@thaJeztah thaJeztah added this to the 28.0.1 milestone Feb 20, 2025
@thaJeztah thaJeztah merged commit 2493a96 into docker:master Feb 20, 2025
106 of 113 checks passed
@thaJeztah thaJeztah deleted the fix_context_err branch February 20, 2025 17:37
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.

CLI raises spurious error on docker context create (CLI v 28)
3 participants