Skip to content

Conversation

@thaJeztah
Copy link
Member

It's the only use of this function, and it's better to check that
the client actually sends the header.

- Description for the changelog

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

@thaJeztah
Copy link
Member Author

Hmm... looks like this fails currently, because golang only resolves the proxy configuration once (using a sync.Once) and because this test actually makes a request, expectations for other tests fail 😞

--- FAIL: TestNewAPIClientFromFlagsWithHttpProxyEnv (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x67898a]

goroutine 49 [running]:
testing.tRunner.func1(0xc000334a00)
	/usr/local/go/src/testing/testing.go:874 +0x3a3
panic(0xb708a0, 0x12844d0)
	/usr/local/go/src/runtime/panic.go:679 +0x1b2
net/url.(*URL).String(0x0, 0xc000334a00, 0x0)
	/usr/local/go/src/net/url/url.go:775 +0x4a
github.com/docker/cli/cli/command.TestNewAPIClientFromFlagsWithHttpProxyEnv(0xc000334a00)
	/go/src/github.com/docker/cli/cli/command/cli_test.go:111 +0x39c
testing.tRunner(0xc000334a00, 0xc94ba0)
	/usr/local/go/src/testing/testing.go:909 +0xc9
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:960 +0x350
FAIL	github.com/docker/cli/cli/command	0.013s

@thaJeztah thaJeztah marked this pull request as draft July 22, 2021 12:33
@thaJeztah thaJeztah force-pushed the no_custom_http_headers branch 10 times, most recently from 3bb4c2f to cc709c3 Compare July 28, 2021 16:17
@codecov-commenter
Copy link

codecov-commenter commented Jul 28, 2021

Codecov Report

Merging #3203 (cc709c3) into master (c9f8473) will not change coverage.
The diff coverage is n/a.

❗ Current head cc709c3 differs from pull request most recent head 0b2eaa7. Consider uploading reports for the commit 0b2eaa7 to get more accurate results

@@           Coverage Diff           @@
##           master    #3203   +/-   ##
=======================================
  Coverage   58.58%   58.58%           
=======================================
  Files         299      299           
  Lines       21502    21502           
=======================================
  Hits        12597    12597           
  Misses       7983     7983           
  Partials      922      922           

@thaJeztah thaJeztah force-pushed the no_custom_http_headers branch from cc709c3 to 3769fa6 Compare July 28, 2021 20:34
@thaJeztah thaJeztah mentioned this pull request Jul 29, 2021
It's the only use of this function, and it's better to check that
the client actually sends the header.

This also simplifies some asserts, and makes sure that "actual" and "expected"
are in the correct order.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Copy link
Contributor

@silvin-lubecki silvin-lubecki 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 thaJeztah merged commit 13e4a09 into docker:master Jul 29, 2021
@thaJeztah thaJeztah deleted the no_custom_http_headers branch July 29, 2021 11:21
@thaJeztah thaJeztah added this to the 21.xx milestone Oct 7, 2021
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.

3 participants