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

Add --device support for Windows #1290

Closed
wants to merge 1 commit into from
Closed

Add --device support for Windows #1290

wants to merge 1 commit into from

Conversation

jterry75
Copy link

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

Signed-off-by: Justin Terry (VM) juterry@microsoft.com

@jhowardmsft - FYI

@jterry75
Copy link
Author

See: moby/moby:37638 for daemon side PR

@codecov-io
Copy link

codecov-io commented Aug 14, 2018

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

@lowenna
Copy link
Contributor

lowenna commented Aug 14, 2018

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

@jterry75
Copy link
Author

jterry75 commented Sep 7, 2018

@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) <juterry@microsoft.com>
@jterry75
Copy link
Author

jterry75 commented Nov 7, 2018

@jhowardmsft - This is the client side. PTAL

@lowenna
Copy link
Contributor

lowenna commented Nov 8, 2018

LGTM (not a maintainer)

@lowenna
Copy link
Contributor

lowenna commented Nov 29, 2018

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

@@ -0,0 +1,115 @@
// +build !windows
Copy link
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
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
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
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
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
Copy link
Author

jterry75 commented Jan 8, 2019

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.

None yet

5 participants