From bfe61fa574321474c4b278afb39af95464efad43 Mon Sep 17 00:00:00 2001 From: ldsdsy Date: Mon, 20 Jun 2022 21:52:50 +0800 Subject: [PATCH] Fix a typo --- staging/src/k8s.io/client-go/rest/connection_test.go | 4 ++-- staging/src/k8s.io/client-go/rest/request.go | 2 +- staging/src/k8s.io/client-go/rest/request_test.go | 8 ++++---- staging/src/k8s.io/client-go/rest/with_retry.go | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/staging/src/k8s.io/client-go/rest/connection_test.go b/staging/src/k8s.io/client-go/rest/connection_test.go index 89d1b3512fe..323c9eecf6f 100644 --- a/staging/src/k8s.io/client-go/rest/connection_test.go +++ b/staging/src/k8s.io/client-go/rest/connection_test.go @@ -169,7 +169,7 @@ func TestReconnectBrokenTCP(t *testing.T) { // 2. the connection has keepalive enabled so it will be reused // 3. break the TCP connection stopping the proxy // 4. close the idle connection to force creating a new connection -// 5. count that there are 2 connection to the server (we didn't reuse the original connection) +// 5. count that there are 2 connections to the server (we didn't reuse the original connection) func TestReconnectBrokenTCP_HTTP1(t *testing.T) { ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, %s", r.Proto) @@ -245,7 +245,7 @@ func TestReconnectBrokenTCP_HTTP1(t *testing.T) { // 1. connect to https server with http1.1 using a TCP proxy making the connection to timeout // 2. the connection has keepalive enabled so it will be reused // 3. close the in-flight connection to force creating a new connection -// 4. count that there are 2 connection on the LB but only one succeeds +// 4. count that there are 2 connections on the LB but only one succeeds func TestReconnectBrokenTCPInFlight_HTTP1(t *testing.T) { done := make(chan struct{}) defer close(done) diff --git a/staging/src/k8s.io/client-go/rest/request.go b/staging/src/k8s.io/client-go/rest/request.go index 3a1560df0dc..f5c2f62e013 100644 --- a/staging/src/k8s.io/client-go/rest/request.go +++ b/staging/src/k8s.io/client-go/rest/request.go @@ -892,7 +892,7 @@ func (r *Request) request(ctx context.Context, fn func(*http.Request, *http.Resp done := func() bool { defer readAndCloseResponseBody(resp) - // if the the server returns an error in err, the response will be nil. + // if the server returns an error in err, the response will be nil. f := func(req *http.Request, resp *http.Response) { if resp == nil { return diff --git a/staging/src/k8s.io/client-go/rest/request_test.go b/staging/src/k8s.io/client-go/rest/request_test.go index 01e18251815..ddde5f767a0 100644 --- a/staging/src/k8s.io/client-go/rest/request_test.go +++ b/staging/src/k8s.io/client-go/rest/request_test.go @@ -2564,7 +2564,7 @@ func TestRequestWatchWithRetry(t *testing.T) { testRequestWithRetry(t, "Watch", func(ctx context.Context, r *Request) { w, err := r.Watch(ctx) if err == nil { - // in this test the the response body returned by the server is always empty, + // in this test the response body returned by the server is always empty, // this will cause StreamWatcher.receive() to: // - return an io.EOF to indicate that the watch closed normally and // - then close the io.Reader @@ -2592,7 +2592,7 @@ func TestRequestWatchRetryWithRateLimiterBackoffAndMetrics(t *testing.T) { testRetryWithRateLimiterBackoffAndMetrics(t, "Watch", func(ctx context.Context, r *Request) { w, err := r.Watch(ctx) if err == nil { - // in this test the the response body returned by the server is always empty, + // in this test the response body returned by the server is always empty, // this will cause StreamWatcher.receive() to: // - return an io.EOF to indicate that the watch closed normally and // - then close the io.Reader @@ -2620,7 +2620,7 @@ func TestRequestWatchWithRetryInvokeOrder(t *testing.T) { testWithRetryInvokeOrder(t, "Watch", func(ctx context.Context, r *Request) { w, err := r.Watch(ctx) if err == nil { - // in this test the the response body returned by the server is always empty, + // in this test the response body returned by the server is always empty, // this will cause StreamWatcher.receive() to: // - return an io.EOF to indicate that the watch closed normally and // - then close the io.Reader @@ -2635,7 +2635,7 @@ func TestRequestWatchWithWrapPreviousError(t *testing.T) { testWithWrapPreviousError(t, func(ctx context.Context, r *Request) error { w, err := r.Watch(ctx) if err == nil { - // in this test the the response body returned by the server is always empty, + // in this test the response body returned by the server is always empty, // this will cause StreamWatcher.receive() to: // - return an io.EOF to indicate that the watch closed normally and // - then close the io.Reader diff --git a/staging/src/k8s.io/client-go/rest/with_retry.go b/staging/src/k8s.io/client-go/rest/with_retry.go index 383a7ca7715..bdcc6f3a98d 100644 --- a/staging/src/k8s.io/client-go/rest/with_retry.go +++ b/staging/src/k8s.io/client-go/rest/with_retry.go @@ -222,7 +222,7 @@ func (r *withRetry) Before(ctx context.Context, request *Request) error { } } - // if we are here, we have made attempt(s) al least once before. + // if we are here, we have made attempt(s) at least once before. if request.backoff != nil { delay := request.backoff.CalculateBackoff(url) if r.retryAfter.Wait > delay {