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

Refactor streaming code to support interop testing #16451

Merged
merged 1 commit into from Apr 2, 2016

Conversation

ncdc
Copy link
Member

@ncdc ncdc commented Oct 28, 2015

Refactor exec/attach/port forward client and server code to better
support interop testing of different client and server subprotocol
versions.

Fixes #16119

@ncdc
Copy link
Member Author

ncdc commented Oct 28, 2015

@smarterclayton @lavalamp @liggitt here's my WIP on #16119

@k8s-bot
Copy link

k8s-bot commented Oct 28, 2015

GCE e2e build/test failed for commit 85e4045030e14b1aa14880669d5b812a94704025.

@k8s-github-robot
Copy link

Labelling this PR as size/XXL

@k8s-github-robot k8s-github-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 28, 2015
@k8s-bot
Copy link

k8s-bot commented Nov 23, 2015

GCE e2e test build/test passed for commit d56f72058496f49e116f30648a61e788bde0f364.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 6, 2015
@k8s-bot
Copy link

k8s-bot commented Dec 11, 2015

GCE e2e test build/test passed for commit d56f72058496f49e116f30648a61e788bde0f364.

@ncdc
Copy link
Member Author

ncdc commented Dec 11, 2015

@smarterclayton @lavalamp are you interested in having me continue with this? If so, I'll rebase and would appreciate feedback. If not, we can close it.

@yujuhong yujuhong assigned smarterclayton and unassigned yujuhong Dec 11, 2015
@smarterclayton
Copy link
Contributor

I think it's a good thing to do, it's your call though whether it's more
important than other changes you have.

On Fri, Dec 11, 2015 at 2:38 PM, Yu-Ju Hong notifications@github.com
wrote:

Assigned #16451 #16451 to
@smarterclayton https://github.com/smarterclayton.


Reply to this email directly or view it on GitHub
#16451 (comment).

@ncdc
Copy link
Member Author

ncdc commented Dec 11, 2015

I'm looking for feedback on the current state of the PR to see if it's in the right direction. Also, when we move to HTTP/2, it's highly likely that the httpstream package's Connection and Stream types will become deprecated; they're not used for the websocket implementation, and the HTTP/2 implementation pattern will likely be operating solely on the request and response bodies and muxing stdout/stderr as needed (similar to how you did it in the wsstream).

@ncdc
Copy link
Member Author

ncdc commented Dec 11, 2015

But I do also think helping David out with the group / version / kind apiserver changes are more important.

@smarterclayton
Copy link
Contributor

The structure looks fine to me. Anything is better than the mess before. This is less bad.

@ncdc ncdc changed the title [do not merge] WIP: Refactor streaming code to support interop testing Refactor streaming code to support interop testing Jan 18, 2016
@ncdc
Copy link
Member Author

ncdc commented Jan 18, 2016

@lavalamp @smarterclayton @liggitt PR updated (finally), PTAL

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 18, 2016
@ncdc
Copy link
Member Author

ncdc commented Jan 18, 2016

I see I have some import direction issues that are causing the httptest.serve flag to leak into most/all of the CLI commands. Working on a fix now.

@k8s-bot
Copy link

k8s-bot commented Jan 18, 2016

GCE e2e test build/test passed for commit 925767319e56e468c8dec23490a1df91d056d89e.

@ncdc
Copy link
Member Author

ncdc commented Jan 18, 2016

Apparently the leaking is occurring because pkg/kubectl/cmd/exec.go and pkg/kubectl/cmd/attach.go are importing pkg/kubelet/server to make use of my new server.SupportedStreamingProtocols var in this PR. I'm not sure why importing that package would yield an httptest flag coming into the picture, though. It looks like the server package only imports httptest in server_test.go...

@ncdc
Copy link
Member Author

ncdc commented Jan 18, 2016

Well this was fun: pkg/kubelet/server -> pkg/kubelet/container -> https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/container/runtime_mock.go#L22 which ultimately imports httptest

@ncdc
Copy link
Member Author

ncdc commented Jan 18, 2016

Ok, so the question is this: is it appropriate to put SupportedStreamingProtocols in pkg/kubelet/server? If so, then we are going to end up with --httptest.serve being a new no-op flag in all kubectl commands until we can resolve what to do about pkg/kubelet/container/runtime_mock.go, since that's ultimately responsible for pulling in httptest.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 21, 2016
@yujuhong
Copy link
Contributor

@ncdc, if the runtime_mock.go file is causing problems, I can move it to the test file that's using the mock until we have better solutions.

@smarterclayton
Copy link
Contributor

I'd prefer to fix runtime_mock.go if at all possible (by changing how the flag is registered).

@ncdc
Copy link
Member Author

ncdc commented Jan 22, 2016

@smarterclayton any regular (non-test) file that pulls in testify's mock package will end up transitively pulling in net/http/httptest, and the httptest package has a flag that is registered as soon as you import the package. It's not just the Kubernetes code that has an issue... I found some code that the Mesos cloud provider imports (another Mesos library) that also has a mock, so even if we fix it here, it's not a complete fix...

@k8s-bot
Copy link

k8s-bot commented Mar 22, 2016

GCE e2e build/test passed for commit 54e8b98497daf287b3bd091dd71ad213e947b83a.

@ncdc
Copy link
Member Author

ncdc commented Mar 22, 2016

@kubernetes/rh-cluster-infra PTAL if you have some time to review

)

// standardShellChannels returns the standard channel types for a shell connection (STDIN 0, STDOUT 1, STDERR 2)
// along with the approprxate duplex value
Copy link
Contributor

Choose a reason for hiding this comment

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

Describe what protocols this supports. Typo in approximate

@smarterclayton
Copy link
Contributor

Are the existing E2E tests sufficient to cover this function?

@ncdc
Copy link
Member Author

ncdc commented Apr 1, 2016

Are the existing E2E tests sufficient to cover this function?

They cover whatever the current protocol is. The new unit tests cover version skew testing.

@smarterclayton
Copy link
Contributor

Changes LGTM

@smarterclayton
Copy link
Contributor

Squash and I'll tag

Refactor exec/attach client and server code to better support interoperability testing of different
client and server subprotocol versions.
@ncdc
Copy link
Member Author

ncdc commented Apr 1, 2016

Squashed

@k8s-bot
Copy link

k8s-bot commented Apr 1, 2016

GCE e2e build/test failed for commit 83ea14f586a79e1b9b5901710231f5d9873cb991.

Please reference the list of currently known flakes when examining this failure. If you request a re-test, you must reference the issue describing the flake.

@ncdc
Copy link
Member Author

ncdc commented Apr 1, 2016

Failure was #22639 / #23607

@k8s-bot
Copy link

k8s-bot commented Apr 1, 2016

GCE e2e build/test passed for commit 4551ba6.

@smarterclayton smarterclayton added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 1, 2016
@k8s-github-robot
Copy link

Removing LGTM because the release note process has not been followed.
One of the following labels is required "release-note", "release-note-none", or "release-note-action-required"
Please see: https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/release-notes.md

@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 1, 2016
@ncdc ncdc added release-note-none Denotes a PR that doesn't merit a release note. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Apr 1, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Apr 1, 2016

GCE e2e build/test passed for commit 4551ba6.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Apr 2, 2016

GCE e2e build/test passed for commit 4551ba6.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 3b65927 into kubernetes:master Apr 2, 2016
@ncdc ncdc deleted the exec-interop-testing branch February 13, 2017 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants