add kubelet grpc server for pod-resources service

This commit is contained in:
David Ashpole
2018-11-13 19:25:56 -08:00
parent 288667f436
commit 630cb53f82
29 changed files with 509 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ import (
"net"
"net/url"
"os"
"path/filepath"
"time"
"golang.org/x/sys/unix"
@@ -99,3 +100,12 @@ func parseEndpoint(endpoint string) (string, string, error) {
return u.Scheme, "", fmt.Errorf("protocol %q not supported", u.Scheme)
}
}
// LocalEndpoint returns the full path to a unix socket at the given endpoint
func LocalEndpoint(path, file string) string {
u := url.URL{
Scheme: unixProtocol,
Path: path,
}
return filepath.Join(u.String(), file+".sock")
}