Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Support named pipe mounts for Windows containers#1511

Merged
mikebrow merged 1 commit intocontainerd:masterfrom
kevpar:named-pipe-mounts
Jun 25, 2020
Merged

Support named pipe mounts for Windows containers#1511
mikebrow merged 1 commit intocontainerd:masterfrom
kevpar:named-pipe-mounts

Conversation

@kevpar
Copy link
Copy Markdown
Member

@kevpar kevpar commented Jun 16, 2020

Adds support to mount named pipes into Windows containers. This support
already exists in hcsshim, so this change just passes them through
correctly in cri. Named pipe mounts must start with "\.\pipe".

Signed-off-by: Kevin Parsons kevpar@microsoft.com

Fixes containerd/containerd#4320

@k8s-ci-robot
Copy link
Copy Markdown

Hi @kevpar. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@kevpar
Copy link
Copy Markdown
Member Author

kevpar commented Jun 16, 2020

Looks like appveyor broke on downloading mingw:

Downloading mingw 
  from 'https://downloads.sourceforge.net/mingw-w64/x86_64-5.3.0-release-posix-seh-rt_v4-rev0.7z'
ERROR: The remote file either doesn't exist, is unauthorized, or is forbidden for url 'https://downloads.sourceforge.net/mingw-w64/x86_64-5.3.0-release-posix-seh-rt_v4-rev0.7z'. Exception calling "GetResponse" with "0" argument(s): "The operation has timed out" 

@mikebrow
Copy link
Copy Markdown
Member

/ok-to-test

@mikebrow
Copy link
Copy Markdown
Member

Looks like appveyor broke on downloading mingw:

Downloading mingw 
  from 'https://downloads.sourceforge.net/mingw-w64/x86_64-5.3.0-release-posix-seh-rt_v4-rev0.7z'
ERROR: The remote file either doesn't exist, is unauthorized, or is forbidden for url 'https://downloads.sourceforge.net/mingw-w64/x86_64-5.3.0-release-posix-seh-rt_v4-rev0.7z'. Exception calling "GetResponse" with "0" argument(s): "The operation has timed out" 

happens all the time..

Copy link
Copy Markdown
Contributor

@jterry75 jterry75 left a comment

Choose a reason for hiding this comment

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

LGTM

@jterry75
Copy link
Copy Markdown
Contributor

@kevpar - Looks like one of the unit tests broke. Need to update the assumption there or else fix the code not sure didnt look into it. But good point, can you add a unit test for this in the same file as well for npipe on windows

@kevpar kevpar force-pushed the named-pipe-mounts branch 4 times, most recently from 8e57b59 to 6841086 Compare June 22, 2020 20:29
Copy link
Copy Markdown
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

looking good just needs a couple tests

@kevpar kevpar force-pushed the named-pipe-mounts branch from 6841086 to 874afbb Compare June 24, 2020 07:52
@kevpar
Copy link
Copy Markdown
Member Author

kevpar commented Jun 24, 2020

@mikebrow I've added a test in container_create_windows_test.go, but since this mocks out the OS, it doesn't validate the filepath interactions. Is there anywhere else I should add a test? It looks like the integration tests don't currently run on Windows (unless I've missed something).

@kevpar
Copy link
Copy Markdown
Member Author

kevpar commented Jun 24, 2020

Got an error that seems unrelated to my changes:

I0624 07:55:20.688] pkg/server/image_pull.go:287:3: SA1019: tlsConfig.BuildNameToCertificate is deprecated: NameToCertificate only allows associating a single certificate with a given name. Leave that field nil to let the library select the first compatible chain from Certificates.  (staticcheck)
I0624 07:55:20.688] 		tlsConfig.BuildNameToCertificate()
I0624 07:55:20.688] 		^

I'll take a look at this tomorrow, just posting in case anyone knows why this was hit.

@mikebrow
Copy link
Copy Markdown
Member

@mikebrow I've added a test in container_create_windows_test.go, but since this mocks out the OS, it doesn't validate the filepath interactions. Is there anywhere else I should add a test? It looks like the integration tests don't currently run on Windows (unless I've missed something).

I think your new test is fine for now. To validate the interactions.... Maybe improve the tests in cri-tools critest under pkg/validate/container*.go.

@mikebrow
Copy link
Copy Markdown
Member

mikebrow commented Jun 24, 2020

Got an error that seems unrelated to my changes:

I0624 07:55:20.688] pkg/server/image_pull.go:287:3: SA1019: tlsConfig.BuildNameToCertificate is deprecated: NameToCertificate only allows associating a single certificate with a given name. Leave that field nil to let the library select the first compatible chain from Certificates.  (staticcheck)
I0624 07:55:20.688] 		tlsConfig.BuildNameToCertificate()
I0624 07:55:20.688] 		^

I'll take a look at this tomorrow, just posting in case anyone knows why this was hit.

let's see... BuildNameToCertificate seems to have been deprecated in go 1.14..
But we are on go 1.13.12.. hmm..
Makefile:

	$(GO) get -d github.com/golangci/golangci-lint/cmd/golangci-lint
	@cd $(GOPATH)/src/github.com/golangci/golangci-lint/cmd/golangci-lint; \
		git checkout v1.18.0; \
		go install

hmm... perhaps there is a golangci-lint already on the path that is a different version? doesn't matter pushing pr to ignore the deprecation lint error.

@mikebrow
Copy link
Copy Markdown
Member

kk fixed ci .. please rebase.

Adds support to mount named pipes into Windows containers. This support
already exists in hcsshim, so this change just passes them through
correctly in cri. Named pipe mounts must start with "\\.\pipe\".

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
@kevpar kevpar force-pushed the named-pipe-mounts branch from 874afbb to 210561a Compare June 25, 2020 19:01
@kevpar
Copy link
Copy Markdown
Member Author

kevpar commented Jun 25, 2020

Looks like all the tests pass now, so I think this is good to go. Thanks @mikebrow for your help!

Copy link
Copy Markdown
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for named pipe mounts for Windows

4 participants