Skip to content

Commit 427cd18

Browse files
authored
Merge pull request kubernetes#127709 from pohly/log-client-go-rest
client-go/rest: finish context support
2 parents 42c4ddb + b738646 commit 427cd18

File tree

36 files changed

+819
-157
lines changed

36 files changed

+819
-157
lines changed

hack/golangci-hints.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ linters-settings: # please keep this alphabetized
143143
contextual k8s.io/api/.*
144144
contextual k8s.io/apimachinery/pkg/util/runtime/.*
145145
contextual k8s.io/client-go/metadata/.*
146+
contextual k8s.io/client-go/rest/.*
146147
contextual k8s.io/client-go/tools/cache/.*
147148
contextual k8s.io/client-go/tools/events/.*
148149
contextual k8s.io/client-go/tools/record/.*

hack/golangci-strict.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ linters-settings: # please keep this alphabetized
189189
contextual k8s.io/api/.*
190190
contextual k8s.io/apimachinery/pkg/util/runtime/.*
191191
contextual k8s.io/client-go/metadata/.*
192+
contextual k8s.io/client-go/rest/.*
192193
contextual k8s.io/client-go/tools/cache/.*
193194
contextual k8s.io/client-go/tools/events/.*
194195
contextual k8s.io/client-go/tools/record/.*

hack/golangci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ linters-settings: # please keep this alphabetized
191191
contextual k8s.io/api/.*
192192
contextual k8s.io/apimachinery/pkg/util/runtime/.*
193193
contextual k8s.io/client-go/metadata/.*
194+
contextual k8s.io/client-go/rest/.*
194195
contextual k8s.io/client-go/tools/cache/.*
195196
contextual k8s.io/client-go/tools/events/.*
196197
contextual k8s.io/client-go/tools/record/.*

hack/logcheck.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ structured k8s.io/apiserver/pkg/server/options/encryptionconfig/.*
2727
contextual k8s.io/api/.*
2828
contextual k8s.io/apimachinery/pkg/util/runtime/.*
2929
contextual k8s.io/client-go/metadata/.*
30+
contextual k8s.io/client-go/rest/.*
3031
contextual k8s.io/client-go/tools/cache/.*
3132
contextual k8s.io/client-go/tools/events/.*
3233
contextual k8s.io/client-go/tools/record/.*

staging/src/k8s.io/apiextensions-apiserver/go.sum

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/apiserver/go.sum

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/client-go/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ require (
5858
github.com/onsi/ginkgo/v2 v2.21.0 // indirect
5959
github.com/pkg/errors v0.9.1 // indirect
6060
github.com/pmezard/go-difflib v1.0.0 // indirect
61+
github.com/stretchr/objx v0.5.2 // indirect
6162
github.com/x448/float16 v0.8.4 // indirect
6263
golang.org/x/sys v0.28.0 // indirect
6364
golang.org/x/text v0.21.0 // indirect

staging/src/k8s.io/client-go/go.sum

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
dir: .
3+
filename: "mock_{{.InterfaceName | snakecase}}_test.go"
4+
boilerplate-file: ../../../../../hack/boilerplate/boilerplate.generatego.txt
5+
outpkg: rest
6+
with-expecter: true
7+
packages:
8+
k8s.io/client-go/rest:
9+
interfaces:
10+
BackoffManager:

staging/src/k8s.io/client-go/rest/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ type RESTClient struct {
9393
content requestClientContentConfigProvider
9494

9595
// creates BackoffManager that is passed to requests.
96-
createBackoffMgr func() BackoffManager
96+
createBackoffMgr func() BackoffManagerWithContext
9797

9898
// rateLimiter is shared among all requests created by this client unless specifically
9999
// overridden.
100100
rateLimiter flowcontrol.RateLimiter
101101

102102
// warningHandler is shared among all requests created by this client.
103103
// If not set, defaultWarningHandler is used.
104-
warningHandler WarningHandler
104+
warningHandler WarningHandlerWithContext
105105

106106
// Set specific behavior of the client. If not set http.DefaultClient will be used.
107107
Client *http.Client
@@ -178,7 +178,7 @@ func (c *RESTClient) GetRateLimiter() flowcontrol.RateLimiter {
178178
// readExpBackoffConfig handles the internal logic of determining what the
179179
// backoff policy is. By default if no information is available, NoBackoff.
180180
// TODO Generalize this see #17727 .
181-
func readExpBackoffConfig() BackoffManager {
181+
func readExpBackoffConfig() BackoffManagerWithContext {
182182
backoffBase := os.Getenv(envBackoffBase)
183183
backoffDuration := os.Getenv(envBackoffDuration)
184184

0 commit comments

Comments
 (0)