Skip to content

integration-cli: Fix SA1019: httputil.ClientConn is deprecated#40074

Merged
AkihiroSuda merged 1 commit intomoby:masterfrom
yedamao:fix-integration-cli
Dec 18, 2019
Merged

integration-cli: Fix SA1019: httputil.ClientConn is deprecated#40074
AkihiroSuda merged 1 commit intomoby:masterfrom
yedamao:fix-integration-cli

Conversation

@yedamao
Copy link
Copy Markdown
Contributor

@yedamao yedamao commented Oct 11, 2019

Rewrite sockRequestHijack to requestHijack which use writable Response.Body

// As of Go 1.12, the Body will also implement io.Writer
// on a successful "101 Switching Protocols" response,
// as used by WebSockets and HTTP/2's "h2c" mode.
Body io.ReadCloser

TestPostContainersAttach and TestExecResizeImmediatelyAfterExecStart
replace all sockRequestHijack to requestHijack.

Signed-off-by: HuanHuan Ye [email protected]

fixes #39927

- What I did
Fix SA1019: httputil.ClientConn is deprecated

- How I did it
Rewrite sockRequestHijack to requestHijack which use writable Response.Body
golang/go#28030 (comment)

- How to verify it
Maybe in CI golangci-lint

- Description for the changelog

integration-cli: Fix SA1019: httputil.ClientConn is deprecated

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

@thaJeztah
Copy link
Copy Markdown
Member

Thanks! Looks like CI is failing on a linting issue;

integration-cli/docker_api_attach_test.go:301:2: unreachable: unreachable code (govet)
	return
	^

@yedamao yedamao force-pushed the fix-integration-cli branch from 0a5ccab to 5c2d1f8 Compare October 14, 2019 06:38
@yedamao
Copy link
Copy Markdown
Contributor Author

yedamao commented Oct 14, 2019

@thaJeztah PTAL. Thanks.

@andrewhsu
Copy link
Copy Markdown
Contributor

@yedamao needs a rebase to address conflicts

@yedamao yedamao force-pushed the fix-integration-cli branch from 5c2d1f8 to 00cd06c Compare October 18, 2019 04:29
@yedamao
Copy link
Copy Markdown
Contributor Author

yedamao commented Oct 18, 2019

@andrewhsu thanks. rebased and fixed conflicts

Comment thread integration-cli/docker_api_attach_test.go Outdated
@yedamao yedamao requested a review from cpuguy83 October 19, 2019 02:46
@yedamao yedamao force-pushed the fix-integration-cli branch from 00cd06c to 0dc82e7 Compare October 22, 2019 02:25
Rewrite sockRequestHijack to requestHijack which use writable
Transport's Response.Body to replace deprecated hijacked httputil.ClientConn.
```
// As of Go 1.12, the Body will also implement io.Writer
// on a successful "101 Switching Protocols" response,
// as used by WebSockets and HTTP/2's "h2c" mode.
Body io.ReadCloser
```.

TestPostContainersAttach and TestExecResizeImmediatelyAfterExecStart
replace all sockRequestHijack to requestHijack.

Signed-off-by: HuanHuan Ye <[email protected]>
@yedamao yedamao force-pushed the fix-integration-cli branch from 0dc82e7 to 203ba72 Compare October 22, 2019 02:56
@yedamao
Copy link
Copy Markdown
Contributor Author

yedamao commented Oct 22, 2019

@cpuguy83 PTAL

Copy link
Copy Markdown
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AkihiroSuda AkihiroSuda merged commit 8b8c01d into moby:master Dec 18, 2019
@thaJeztah thaJeztah added this to the 20.03.0 milestone Apr 2, 2020
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.

Fixme: SA1019: httputil.ClientConn is deprecated

5 participants