Support TCP type runtime endpoint for kubelet.

This commit is contained in:
Dong Liu
2017-05-19 11:18:18 +08:00
parent b6211c6e79
commit fb26c9100a
18 changed files with 344 additions and 56 deletions

View File

@@ -17,6 +17,9 @@ limitations under the License.
package util
import (
"fmt"
"net/url"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
@@ -25,3 +28,18 @@ import (
func FromApiserverCache(opts *metav1.GetOptions) {
opts.ResourceVersion = "0"
}
func parseEndpoint(endpoint string) (string, string, error) {
u, err := url.Parse(endpoint)
if err != nil {
return "", "", err
}
if u.Scheme == "tcp" {
return "tcp", u.Host, nil
} else if u.Scheme == "unix" {
return "unix", u.Path, nil
} else {
return "", "", fmt.Errorf("protocol %q not supported", u.Scheme)
}
}