diff --git a/hack/.golint_failures b/hack/.golint_failures index 8ab29fc3b7a..a3b6ba9c2ee 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -206,7 +206,6 @@ pkg/kubelet/status pkg/kubelet/status/testing pkg/kubelet/sysctl pkg/kubelet/types -pkg/kubelet/util pkg/kubelet/util/pluginwatcher pkg/kubemark pkg/master diff --git a/pkg/kubelet/util/doc.go b/pkg/kubelet/util/doc.go index ac0d4097b8a..eaccd63a356 100644 --- a/pkg/kubelet/util/doc.go +++ b/pkg/kubelet/util/doc.go @@ -14,5 +14,5 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Utility functions. +// Package util holds utility functions. package util // import "k8s.io/kubernetes/pkg/kubelet/util" diff --git a/pkg/kubelet/util/util_unix.go b/pkg/kubelet/util/util_unix.go index 0ddc6384391..46e8e2c5a88 100644 --- a/pkg/kubelet/util/util_unix.go +++ b/pkg/kubelet/util/util_unix.go @@ -35,6 +35,7 @@ const ( unixProtocol = "unix" ) +// CreateListener creates a listener on the specified endpoint. func CreateListener(endpoint string) (net.Listener, error) { protocol, addr, err := parseEndpointWithFallbackProtocol(endpoint, unixProtocol) if err != nil { @@ -53,6 +54,7 @@ func CreateListener(endpoint string) (net.Listener, error) { return net.Listen(protocol, addr) } +// GetAddressAndDialer returns the address parsed from the given endpoint and a dialer. func GetAddressAndDialer(endpoint string) (string, func(addr string, timeout time.Duration) (net.Conn, error), error) { protocol, addr, err := parseEndpointWithFallbackProtocol(endpoint, unixProtocol) if err != nil { diff --git a/pkg/kubelet/util/util_unsupported.go b/pkg/kubelet/util/util_unsupported.go index 68a2bdf01b7..b7fd1b11c76 100644 --- a/pkg/kubelet/util/util_unsupported.go +++ b/pkg/kubelet/util/util_unsupported.go @@ -24,10 +24,12 @@ import ( "time" ) +// CreateListener creates a listener on the specified endpoint. func CreateListener(endpoint string) (net.Listener, error) { return nil, fmt.Errorf("CreateListener is unsupported in this build") } +// GetAddressAndDialer returns the address parsed from the given endpoint and a dialer. func GetAddressAndDialer(endpoint string) (string, func(addr string, timeout time.Duration) (net.Conn, error), error) { return "", nil, fmt.Errorf("GetAddressAndDialer is unsupported in this build") } diff --git a/pkg/kubelet/util/util_windows.go b/pkg/kubelet/util/util_windows.go index 92accc55e14..2028b3f75a2 100644 --- a/pkg/kubelet/util/util_windows.go +++ b/pkg/kubelet/util/util_windows.go @@ -34,6 +34,7 @@ const ( npipeProtocol = "npipe" ) +// CreateListener creates a listener on the specified endpoint. func CreateListener(endpoint string) (net.Listener, error) { protocol, addr, err := parseEndpoint(endpoint) if err != nil { @@ -52,6 +53,7 @@ func CreateListener(endpoint string) (net.Listener, error) { } } +// GetAddressAndDialer returns the address parsed from the given endpoint and a dialer. func GetAddressAndDialer(endpoint string) (string, func(addr string, timeout time.Duration) (net.Conn, error), error) { protocol, addr, err := parseEndpoint(endpoint) if err != nil {