Merge pull request #5357 from thxCode/support_windows_debug
fix(windows): create debug npipe failure
This commit is contained in:
commit
c02081fdc1
@ -190,7 +190,7 @@ can be used and modified as necessary as a custom configuration.`
|
|||||||
|
|
||||||
if config.Debug.Address != "" {
|
if config.Debug.Address != "" {
|
||||||
var l net.Listener
|
var l net.Listener
|
||||||
if filepath.IsAbs(config.Debug.Address) {
|
if isLocalAddress(config.Debug.Address) {
|
||||||
if l, err = sys.GetLocalListener(config.Debug.Address, config.Debug.UID, config.Debug.GID); err != nil {
|
if l, err = sys.GetLocalListener(config.Debug.Address, config.Debug.UID, config.Debug.GID); err != nil {
|
||||||
return errors.Wrapf(err, "failed to get listener for debug endpoint")
|
return errors.Wrapf(err, "failed to get listener for debug endpoint")
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ package command
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/containerd/containerd/log"
|
"github.com/containerd/containerd/log"
|
||||||
"github.com/containerd/containerd/services/server"
|
"github.com/containerd/containerd/services/server"
|
||||||
@ -72,3 +73,7 @@ func handleSignals(ctx context.Context, signals chan os.Signal, serverC chan *se
|
|||||||
}()
|
}()
|
||||||
return done
|
return done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isLocalAddress(path string) bool {
|
||||||
|
return filepath.IsAbs(path)
|
||||||
|
}
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/Microsoft/go-winio/pkg/etw"
|
"github.com/Microsoft/go-winio/pkg/etw"
|
||||||
@ -117,3 +118,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isLocalAddress(path string) bool {
|
||||||
|
return strings.HasPrefix(path, `\\.\pipe\`)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user