Merge pull request #111002 from HecarimV/fix-220707

fix static-check for staging/src/k8s.io/client-go/

Kubernetes-commit: 09e8339ae4e575ec40e8ed0fc2829fcb678c0f19
This commit is contained in:
Kubernetes Publisher 2022-07-13 01:01:37 -07:00
commit eabd4289b0
4 changed files with 10 additions and 10 deletions

4
go.mod
View File

@ -25,7 +25,7 @@ require (
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 golang.org/x/time v0.0.0-20220210224613-90d013bbcef8
google.golang.org/protobuf v1.27.1 google.golang.org/protobuf v1.27.1
k8s.io/api v0.0.0-20220709052054-b9bd7327add9 k8s.io/api v0.0.0-20220709052054-b9bd7327add9
k8s.io/apimachinery v0.0.0-20220708171815-9cb1f71d9bce k8s.io/apimachinery v0.0.0-20220713051826-0897ed8d5be4
k8s.io/klog/v2 v2.70.1 k8s.io/klog/v2 v2.70.1
k8s.io/kube-openapi v0.0.0-20220627174259-011e075b9cb8 k8s.io/kube-openapi v0.0.0-20220627174259-011e075b9cb8
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
@ -62,5 +62,5 @@ require (
replace ( replace (
k8s.io/api => k8s.io/api v0.0.0-20220709052054-b9bd7327add9 k8s.io/api => k8s.io/api v0.0.0-20220709052054-b9bd7327add9
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20220708171815-9cb1f71d9bce k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20220713051826-0897ed8d5be4
) )

4
go.sum
View File

@ -481,8 +481,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20220709052054-b9bd7327add9 h1:FEAp0lzAf22GNplJSRIT174/pN71JLVsgVQGdB5OPVo= k8s.io/api v0.0.0-20220709052054-b9bd7327add9 h1:FEAp0lzAf22GNplJSRIT174/pN71JLVsgVQGdB5OPVo=
k8s.io/api v0.0.0-20220709052054-b9bd7327add9/go.mod h1:mu5fbjml8u+WuYagoAcCQ+yMPxydoFY51dJq/r0+XtY= k8s.io/api v0.0.0-20220709052054-b9bd7327add9/go.mod h1:mu5fbjml8u+WuYagoAcCQ+yMPxydoFY51dJq/r0+XtY=
k8s.io/apimachinery v0.0.0-20220708171815-9cb1f71d9bce h1:tQ0EgeSrxtam8cATjAGxIMZtZnsajmhomx9dDa4sFDI= k8s.io/apimachinery v0.0.0-20220713051826-0897ed8d5be4 h1:kh78v75M4kX6pOs8MywC8OcEoM6zSsDw1eI4h+9Zm0k=
k8s.io/apimachinery v0.0.0-20220708171815-9cb1f71d9bce/go.mod h1:0qktsm8TIQ7Y3rLpUe4SLWy+3L6Su5aSoIQxgqO+4ks= k8s.io/apimachinery v0.0.0-20220713051826-0897ed8d5be4/go.mod h1:0qktsm8TIQ7Y3rLpUe4SLWy+3L6Su5aSoIQxgqO+4ks=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ= k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ=
k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=

View File

@ -491,7 +491,7 @@ func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, e
DNSDone: func(info httptrace.DNSDoneInfo) { DNSDone: func(info httptrace.DNSDoneInfo) {
reqInfo.muTrace.Lock() reqInfo.muTrace.Lock()
defer reqInfo.muTrace.Unlock() defer reqInfo.muTrace.Unlock()
reqInfo.DNSLookup = time.Now().Sub(dnsStart) reqInfo.DNSLookup = time.Since(dnsStart)
klog.Infof("HTTP Trace: DNS Lookup for %s resolved to %v", host, info.Addrs) klog.Infof("HTTP Trace: DNS Lookup for %s resolved to %v", host, info.Addrs)
}, },
// Dial // Dial
@ -503,7 +503,7 @@ func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, e
ConnectDone: func(network, addr string, err error) { ConnectDone: func(network, addr string, err error) {
reqInfo.muTrace.Lock() reqInfo.muTrace.Lock()
defer reqInfo.muTrace.Unlock() defer reqInfo.muTrace.Unlock()
reqInfo.Dialing = time.Now().Sub(dialStart) reqInfo.Dialing = time.Since(dialStart)
if err != nil { if err != nil {
klog.Infof("HTTP Trace: Dial to %s:%s failed: %v", network, addr, err) klog.Infof("HTTP Trace: Dial to %s:%s failed: %v", network, addr, err)
} else { } else {
@ -517,7 +517,7 @@ func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, e
TLSHandshakeDone: func(_ tls.ConnectionState, _ error) { TLSHandshakeDone: func(_ tls.ConnectionState, _ error) {
reqInfo.muTrace.Lock() reqInfo.muTrace.Lock()
defer reqInfo.muTrace.Unlock() defer reqInfo.muTrace.Unlock()
reqInfo.TLSHandshake = time.Now().Sub(tlsStart) reqInfo.TLSHandshake = time.Since(tlsStart)
}, },
// Connection (it can be DNS + Dial or just the time to get one from the connection pool) // Connection (it can be DNS + Dial or just the time to get one from the connection pool)
GetConn: func(hostPort string) { GetConn: func(hostPort string) {
@ -526,7 +526,7 @@ func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, e
GotConn: func(info httptrace.GotConnInfo) { GotConn: func(info httptrace.GotConnInfo) {
reqInfo.muTrace.Lock() reqInfo.muTrace.Lock()
defer reqInfo.muTrace.Unlock() defer reqInfo.muTrace.Unlock()
reqInfo.GetConnection = time.Now().Sub(getConn) reqInfo.GetConnection = time.Since(getConn)
reqInfo.ConnectionReused = info.Reused reqInfo.ConnectionReused = info.Reused
}, },
// Server Processing (time since we wrote the request until first byte is received) // Server Processing (time since we wrote the request until first byte is received)
@ -538,7 +538,7 @@ func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, e
GotFirstResponseByte: func() { GotFirstResponseByte: func() {
reqInfo.muTrace.Lock() reqInfo.muTrace.Lock()
defer reqInfo.muTrace.Unlock() defer reqInfo.muTrace.Unlock()
reqInfo.ServerProcessing = time.Now().Sub(serverStart) reqInfo.ServerProcessing = time.Since(serverStart)
}, },
} }
req = req.WithContext(httptrace.WithClientTrace(req.Context(), trace)) req = req.WithContext(httptrace.WithClientTrace(req.Context(), trace))

View File

@ -100,7 +100,7 @@ func TestCloseAllRace(t *testing.T) {
dialer.CloseAll() dialer.CloseAll()
// Expect all connections to close within 5 seconds // Expect all connections to close within 5 seconds
for start := time.Now(); time.Now().Sub(start) < 5*time.Second; time.Sleep(10 * time.Millisecond) { for start := time.Now(); time.Since(start) < 5*time.Second; time.Sleep(10 * time.Millisecond) {
// Ensure all connections were closed // Ensure all connections were closed
if c := atomic.LoadInt64(&conns); c == 0 { if c := atomic.LoadInt64(&conns); c == 0 {
break break