Make name validators return string slices

This commit is contained in:
Tim Hockin
2015-12-15 22:03:20 -08:00
parent 66d0d87829
commit 152c86ab06
17 changed files with 140 additions and 181 deletions

View File

@@ -21,6 +21,7 @@ import (
"fmt"
"net"
"net/http"
"strings"
"time"
"k8s.io/kubernetes/pkg/api"
@@ -98,8 +99,8 @@ func NewStaticKubeletClient(config *KubeletClientConfig) (KubeletClient, error)
// In default HTTPKubeletClient ctx is unused.
func (c *HTTPKubeletClient) GetConnectionInfo(ctx api.Context, nodeName string) (string, uint, http.RoundTripper, error) {
if ok, msg := validation.ValidateNodeName(nodeName, false); !ok {
return "", 0, nil, fmt.Errorf("invalid node name: %s", msg)
if errs := validation.ValidateNodeName(nodeName, false); len(errs) != 0 {
return "", 0, nil, fmt.Errorf("invalid node name: %s", strings.Join(errs, ";"))
}
scheme := "http"
if c.Config.EnableHttps {