Update ctr so it works again on windows

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure
2017-07-16 12:37:04 +02:00
parent 61fbd2311c
commit a4aaa09ccc
19 changed files with 164 additions and 201 deletions

View File

@@ -3,13 +3,12 @@ package main
import (
"fmt"
"io"
"net"
"net/http"
"os"
"time"
"github.com/containerd/containerd/server"
"github.com/pkg/errors"
"github.com/urfave/cli"
)
@@ -25,7 +24,7 @@ var pprofCommand = cli.Command{
cli.StringFlag{
Name: "debug-socket, d",
Usage: "socket path for containerd's debug server",
Value: "/run/containerd/debug.sock",
Value: server.DefaultDebugAddress,
},
},
Subcommands: []cli.Command{
@@ -143,13 +142,8 @@ var pprofThreadcreateCommand = cli.Command{
},
}
func (d *pprofDialer) pprofDial(proto, addr string) (conn net.Conn, err error) {
return net.Dial(d.proto, d.addr)
}
func getPProfClient(context *cli.Context) *http.Client {
addr := context.GlobalString("debug-socket")
dialer := pprofDialer{"unix", addr}
dialer := getPProfDialer(context.GlobalString("debug-socket"))
tr := &http.Transport{
Dial: dialer.pprofDial,