Skip to content

Add --device support for Windows#1290

Closed
jterry75 wants to merge 1 commit into
docker:masterfrom
jterry75:add_device_support
Closed

Add --device support for Windows#1290
jterry75 wants to merge 1 commit into
docker:masterfrom
jterry75:add_device_support

Conversation

@jterry75

Copy link
Copy Markdown

Adds support for --device in Windows. This must take the form of:
--device='class/{clsid}'

Signed-off-by: Justin Terry (VM) [email protected]

@jhowardmsft - FYI

@jterry75

Copy link
Copy Markdown
Author

See: moby/moby:37638 for daemon side PR

@codecov-io

codecov-io commented Aug 14, 2018

Copy link
Copy Markdown

Codecov Report

Merging #1290 into master will not change coverage.
The diff coverage is 97.1%.

@@           Coverage Diff           @@
##           master    #1290   +/-   ##
=======================================
  Coverage   55.14%   55.14%           
=======================================
  Files         289      290    +1     
  Lines       19371    19371           
=======================================
  Hits        10683    10683           
  Misses       7997     7997           
  Partials      691      691

Comment thread cli/command/container/opts_windows.go Outdated
@lowenna

lowenna commented Aug 14, 2018

Copy link
Copy Markdown
Contributor

Think there's a typo on an error string. Otherwise code LGTM (not a maintainer in this repo)

@jterry75

jterry75 commented Sep 7, 2018

Copy link
Copy Markdown
Author

@thaJeztah - Is there anything I can help with to get this in?

Adds support for --device in Windows. This must take the form of:
--device='class/{clsid}'

Signed-off-by: Justin Terry (VM) <[email protected]>
@jterry75

jterry75 commented Nov 7, 2018

Copy link
Copy Markdown
Author

@jhowardmsft - This is the client side. PTAL

@lowenna

lowenna commented Nov 8, 2018

Copy link
Copy Markdown
Contributor

LGTM (not a maintainer)

@lowenna

lowenna commented Nov 29, 2018

Copy link
Copy Markdown
Contributor

@thaJeztah Can this be merged now the daemon side is in?

@@ -0,0 +1,115 @@
// +build !windows

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤔 Not compiling this on Windows means that starting a Linux container (Docker Desktop for Windows, or a Windows client connecting to a remote Linux daemon) will no longer be functional; I guess that's not what we want 😅

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

How do you suggest I determine when to use what parser for the device assignment? I would have to ping the end node to determine if its a Windows or Linux host first?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Take a look at cli\command\cli.go L212, function initializeFromClient. You can pull the server OS out of cli.serverInfo.OSType. IIRC every CLI command starts with a _ping API.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, unfortunately it gets complicated fast to take mixed environments into account 😞. I guess we should keep the separate functions for windows and linux (to keep it clean), and add a wrapper function that calls one of them, based on what the target platform is

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If possible (not sure that is in this case (haven't looked in depth)), we try to reduce validation on the client side to a minimum, and leave it to the daemon to return an error.

@jterry75

jterry75 commented Jan 8, 2019

Copy link
Copy Markdown
Author

Closing in favor of #1606

@jterry75 jterry75 closed this Jan 8, 2019
@jterry75
jterry75 deleted the add_device_support branch January 8, 2019 16:08
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.

5 participants