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

A few fixes to defaults on Windows. #374

Merged
merged 2 commits into from
Sep 7, 2018
Merged

A few fixes to defaults on Windows. #374

merged 2 commits into from
Sep 7, 2018

Conversation

jterry75
Copy link
Contributor

@jterry75 jterry75 commented Sep 4, 2018

Makes the default config location GOOS dependent to support Windows
paths if the tool is running on Windows.

Sets the default connection endpoint for Windows to be
\.\pipe\dockershim.

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 4, 2018
@jterry75
Copy link
Contributor Author

jterry75 commented Sep 4, 2018

@Random-Liu - Working on getting the CLA signed.

@Random-Liu
Copy link
Contributor

Random-Liu commented Sep 4, 2018

It seems that the library we are using already supported windows. https://github.com/kubernetes/kubernetes/tree/master/pkg/kubelet/util

@jterry75 Doesn't it work? And I think the dockershim windows support today is using that.

@jterry75
Copy link
Contributor Author

jterry75 commented Sep 4, 2018

@Random-Liu - Only supports TCP see util_windows.go#L48. Given that CRI is local only it should use npipe on Windows.

@Random-Liu
Copy link
Contributor

Random-Liu commented Sep 4, 2018

@jterry75 I see. If containerd is going to provide npipe on Windows, we should eventually update the kubelet util library to support it, thus kubelet can use it. But I'm fine with starting from crictl/critest for development first. :)

/cc @feiskyer who knows more about windows. Does crictl and critest work on Windows now? If it works, we may not want to break users who are using it.

@jterry75
Copy link
Contributor Author

jterry75 commented Sep 4, 2018

@Random-Liu - I pushed and update that keep the old behavior if indeed people need tcp support for crictl on Windows. This will just inspect the EP and return an dialer for NamedPipes if the EP is a pipe path otherwise uses the util package as it used to.

@feiskyer
Copy link
Member

feiskyer commented Sep 5, 2018

dockershim on Windows listens to "tcp://localhost:3735", so tcp should also be supported on Windows.

We should update util package to support both tcp and npipe on Windows, so that containerd would work for kubelet.

@jterry75
Copy link
Contributor Author

jterry75 commented Sep 5, 2018

@feiskyer - I can update it there that's fine. This change would support both tcp and npipe on Windows now though. Do you see any issues with that?

@jterry75
Copy link
Contributor Author

jterry75 commented Sep 5, 2018

@feiskyer @Random-Liu Here is a change in my private fork of Kubernetes as well: jterry75/kubernetes:a2f144. I assume this is the right long term solution that you were looking for?

@jterry75
Copy link
Contributor Author

jterry75 commented Sep 6, 2018

@feiskyer - Changes the default to tcp as you requested but leaves support for npipe

@feiskyer
Copy link
Member

feiskyer commented Sep 7, 2018

@jterry75 Thanks. LGTM, but let's wait a while for #376 because the repo has been moved to new org.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Sep 7, 2018
@feiskyer feiskyer closed this Sep 7, 2018
@feiskyer feiskyer reopened this Sep 7, 2018
defaultRuntimeEndpoint = "unix:///var/run/dockershim.sock"
)

func GetAddressAndDialer(endpoint string) (string, func(addr string, timeout time.Duration) (net.Conn, error), error) {
Copy link
Member

Choose a reason for hiding this comment

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

Could you also add comments for this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Absolutely!

Makes the default config location GOOS dependent to support Windows
paths if the tool is running on Windows.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
Sets the default connection endpoint for Windows to be
tcp://localhost:3735 to match dockershim.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
@jterry75
Copy link
Contributor Author

jterry75 commented Sep 7, 2018

@feiskyer - PTAL. Rebased on latest master and added comments as requested. I will also make these comments when updating the kubernetes repo as they don't have any currently.

@feiskyer
Copy link
Member

feiskyer commented Sep 7, 2018

@jterry75 Thanks.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 7, 2018
@feiskyer
Copy link
Member

feiskyer commented Sep 7, 2018

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer, jterry75

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 7, 2018
@k8s-ci-robot k8s-ci-robot merged commit 31e2aec into kubernetes-sigs:master Sep 7, 2018
@jterry75 jterry75 deleted the windows_port branch September 17, 2018 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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

4 participants