fix golint failures of pkg/kubelet/prober pkg/kubelet/secret

This commit is contained in:
SataQiu
2019-05-31 17:08:53 +08:00
parent f49fe2a750
commit c6a0f820d8
5 changed files with 11 additions and 9 deletions

View File

@@ -50,8 +50,8 @@ type prober struct {
// probe types needs different httprobe instances so they don't
// share a connection pool which can cause collsions to the
// same host:port and transient failures. See #49740.
readinessHttp httprobe.Prober
livenessHttp httprobe.Prober
readinessHTTP httprobe.Prober
livenessHTTP httprobe.Prober
tcp tcprobe.Prober
runner kubecontainer.ContainerCommandRunner
@@ -69,8 +69,8 @@ func newProber(
const followNonLocalRedirects = false
return &prober{
exec: execprobe.New(),
readinessHttp: httprobe.New(followNonLocalRedirects),
livenessHttp: httprobe.New(followNonLocalRedirects),
readinessHTTP: httprobe.New(followNonLocalRedirects),
livenessHTTP: httprobe.New(followNonLocalRedirects),
tcp: tcprobe.New(),
runner: runner,
refManager: refManager,
@@ -175,10 +175,10 @@ func (pb *prober) runProbe(probeType probeType, p *v1.Probe, pod *v1.Pod, status
headers := buildHeader(p.HTTPGet.HTTPHeaders)
klog.V(4).Infof("HTTP-Probe Headers: %v", headers)
if probeType == liveness {
return pb.livenessHttp.Probe(url, headers, timeout)
} else { // readiness
return pb.readinessHttp.Probe(url, headers, timeout)
return pb.livenessHTTP.Probe(url, headers, timeout)
}
// readiness
return pb.readinessHTTP.Probe(url, headers, timeout)
}
if p.TCPSocket != nil {
port, err := extractPort(p.TCPSocket.Port, container)