mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Merge pull request #76889 from SataQiu/fix-golint-kubelet-util-20190422
Fix golint failures of pkg/kubelet/util
This commit is contained in:
commit
4ec29a1a2b
@ -204,7 +204,6 @@ pkg/kubelet/status
|
|||||||
pkg/kubelet/status/testing
|
pkg/kubelet/status/testing
|
||||||
pkg/kubelet/sysctl
|
pkg/kubelet/sysctl
|
||||||
pkg/kubelet/types
|
pkg/kubelet/types
|
||||||
pkg/kubelet/util
|
|
||||||
pkg/kubelet/util/pluginwatcher
|
pkg/kubelet/util/pluginwatcher
|
||||||
pkg/kubemark
|
pkg/kubemark
|
||||||
pkg/master
|
pkg/master
|
||||||
|
@ -14,5 +14,5 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Utility functions.
|
// Package util holds utility functions.
|
||||||
package util // import "k8s.io/kubernetes/pkg/kubelet/util"
|
package util // import "k8s.io/kubernetes/pkg/kubelet/util"
|
||||||
|
@ -35,6 +35,7 @@ const (
|
|||||||
unixProtocol = "unix"
|
unixProtocol = "unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// CreateListener creates a listener on the specified endpoint.
|
||||||
func CreateListener(endpoint string) (net.Listener, error) {
|
func CreateListener(endpoint string) (net.Listener, error) {
|
||||||
protocol, addr, err := parseEndpointWithFallbackProtocol(endpoint, unixProtocol)
|
protocol, addr, err := parseEndpointWithFallbackProtocol(endpoint, unixProtocol)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -53,6 +54,7 @@ func CreateListener(endpoint string) (net.Listener, error) {
|
|||||||
return net.Listen(protocol, addr)
|
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) {
|
func GetAddressAndDialer(endpoint string) (string, func(addr string, timeout time.Duration) (net.Conn, error), error) {
|
||||||
protocol, addr, err := parseEndpointWithFallbackProtocol(endpoint, unixProtocol)
|
protocol, addr, err := parseEndpointWithFallbackProtocol(endpoint, unixProtocol)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -24,10 +24,12 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// CreateListener creates a listener on the specified endpoint.
|
||||||
func CreateListener(endpoint string) (net.Listener, error) {
|
func CreateListener(endpoint string) (net.Listener, error) {
|
||||||
return nil, fmt.Errorf("CreateListener is unsupported in this build")
|
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) {
|
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")
|
return "", nil, fmt.Errorf("GetAddressAndDialer is unsupported in this build")
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@ const (
|
|||||||
npipeProtocol = "npipe"
|
npipeProtocol = "npipe"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// CreateListener creates a listener on the specified endpoint.
|
||||||
func CreateListener(endpoint string) (net.Listener, error) {
|
func CreateListener(endpoint string) (net.Listener, error) {
|
||||||
protocol, addr, err := parseEndpoint(endpoint)
|
protocol, addr, err := parseEndpoint(endpoint)
|
||||||
if err != nil {
|
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) {
|
func GetAddressAndDialer(endpoint string) (string, func(addr string, timeout time.Duration) (net.Conn, error), error) {
|
||||||
protocol, addr, err := parseEndpoint(endpoint)
|
protocol, addr, err := parseEndpoint(endpoint)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user