Merge pull request #20884 from Microsoft/jjh/integusenpipe
Windows CI: Allow npipe protocol for sock requests Upstream-commit: 361a63e5f2b12c62bc3d9d7393129b323b41694a Component: engine
This commit is contained in:
@ -576,6 +576,8 @@ func sockConn(timeout time.Duration) (net.Conn, error) {
|
||||
|
||||
var c net.Conn
|
||||
switch daemonURL.Scheme {
|
||||
case "npipe":
|
||||
return npipeDial(daemonURL.Path, timeout)
|
||||
case "unix":
|
||||
return net.DialTimeout(daemonURL.Scheme, daemonURL.Path, timeout)
|
||||
case "tcp":
|
||||
|
||||
12
components/engine/integration-cli/npipe.go
Normal file
12
components/engine/integration-cli/npipe.go
Normal file
@ -0,0 +1,12 @@
|
||||
// +build !windows
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
|
||||
func npipeDial(path string, timeout time.Duration) (net.Conn, error) {
|
||||
panic("npipe protocol only supported on Windows")
|
||||
}
|
||||
12
components/engine/integration-cli/npipe_windows.go
Normal file
12
components/engine/integration-cli/npipe_windows.go
Normal file
@ -0,0 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/Microsoft/go-winio"
|
||||
)
|
||||
|
||||
func npipeDial(path string, timeout time.Duration) (net.Conn, error) {
|
||||
return winio.DialPipe(path, &timeout)
|
||||
}
|
||||
Reference in New Issue
Block a user