Commit Graph

2749 Commits

Author SHA1 Message Date
Andrea Tosatto
2bce1731eb Run gofmt against staging/src/k8s.io/client-go/transport/round_trippers.go
Kubernetes-commit: 9cb5580ac6584cc787a2b2061c6c61656d065392
2021-01-26 22:04:52 +00:00
Andrea Tosatto
5c01a03456 client-go: export NewDebuggingRoundTripper function and DebugLevel
`debuggingRoundTripper` is a useful throbleshooting tool to debug of Kubernetes API requests and their timing.

Unfortunately, as of today, it can only be used via the `DebugWrappers` function, which automatically adjust the amount of debug information exposed by the roundTripper based on the configured `klog` verbosity.

While `DebugWrappers` definitely fits the purpose for clients using `klog`, this is currently hard to be used for controllers using `controller-runtime`, which uses `github.com/go-logr/logr` for logging.

In this PR we change the visibility of `newDebuggingRoundTripper` and `debugLevel` in order to be directly accessible from users of the `k8s.io/client-go/transport` package.

In particular, the changes proposed in this PR allow users of `controller-runtime` to use the `debuggingRoundTripper` to intercept Kubernetes API requests as follows

```go
import (
        ctrl "sigs.k8s.io/controller-runtime"
)

func init() {
	ctrl.SetLogger(zap.New())
}

func main() {
        // wrap the http transport used by the Kubernetes client
	restConfig, err := ctrl.GetConfig()
	checkError(setupLog, err, "unable to get kubernetes client config")

        restConfig.Wrap(func(rt http.RoundTripper) http.RoundTripper {
		return transport.NewDebuggingRoundTripper(rt, transport.DebugJustURL)
	})

        ...
}
```

Kubernetes-commit: 8de53ce96cb58d56fd00e91d8bcf7761ab498b83
2021-01-22 14:57:14 +01:00
Kubernetes Publisher
b72204b244 Merge pull request #95664 from DirectXMan12/bug/non-racy-recorder-shutdown
Don't spawn a goroutine for every event recording

Kubernetes-commit: 9d99dbc357ed85bcc963fc4bab8a4a3089c910b2
2021-01-21 07:15:29 +00:00
Kubernetes Publisher
fc034b4b76 Merge pull request #96552 from pandaamanda/klog_fmt
use klog.Info and klog.Warning when had no format

Kubernetes-commit: 8bf42039e62d001f5d0331753bd99790b70d51eb
2021-01-16 05:01:05 +00:00
Kubernetes Publisher
537eda74d8 Merge pull request #98058 from jprzychodzen/le-comment
[Leader election] Add documentation to function

Kubernetes-commit: a16df75344c6036730e1fba42b25c64c704b1494
2021-01-14 13:04:07 +00:00
Kubernetes Publisher
25e8b5f54c Merge pull request #97083 from knight42/feat/enable-spdy-ping
feat: enable SPDY pings on connections

Kubernetes-commit: a3bf53a0a5031f69389a835a8e13e783090b35a7
2021-01-14 01:01:00 +00:00
Jakub Przychodzeń
eae461ddf8 [Leader election] Add documentation to function
Kubernetes-commit: 852075b23c1854d538582e3940dff36947de2907
2021-01-13 17:34:07 +01:00
Jian Zeng
479dd01de2 feat: enable SPDY pings on connections
Signed-off-by: Jian Zeng <zengjian.zj@bytedance.com>

Kubernetes-commit: d0dce7035832f0673d87ae44503560204f3d3d46
2020-12-05 22:31:52 +08:00
Kubernetes Publisher
623741e9c1 Merge pull request #97909 from adamzhoul/fix-chan-bug
fix unit test "TestSPDYExecutorStream" flaking problem

Kubernetes-commit: 9caf675ed1a055ebce18cf34e8284028a729fd00
2021-01-12 05:01:01 +00:00
Kubernetes Publisher
2192138125 Merge pull request #97095 from sabbox/fix-panic-azure-oidc-auth-plugins
fix: Azure/OIDC auth panics when no AuthProviderConfigPersister is nil

Kubernetes-commit: 31e89372716a1414495594ce1a65368e4124db26
2021-01-12 05:00:59 +00:00
Andrey Viktorov
b804f9f657 add noop persister to plugin loader
Kubernetes-commit: 2dd86fe8c2cc7b655085b773bd1a06bc2ab54bbd
2021-01-12 00:08:42 +02:00
Kubernetes Publisher
f80da32721 Merge pull request #97255 from chotiwat/patch-1
Fix stale object causing a panic on DELETE event

Kubernetes-commit: d2575b7ddb374d8ce915fe095fa5b7a5b3df138e
2021-01-11 21:01:20 +00:00
Kubernetes Publisher
224c1c6ff4 Merge pull request #97857 from liggitt/exec-auth-reuse-dialer
Track opened connections with a single tracker per authenticator

Kubernetes-commit: e9dba7a627520f89778b367fc0d955776f220638
2021-01-11 17:01:11 +00:00
adamzhoul
5c32e970ce fix replyChan block
Kubernetes-commit: 314a9c4a6215b7e57944c86acacc5c75ab55121f
2021-01-11 08:36:27 +00:00
Jordan Liggitt
0c5bab64fe Track opened connections with a single tracker per authenticator
Kubernetes-commit: ecbff22ca134bd802127aab2be165d2770a9262a
2021-01-08 12:13:19 -05:00
Chotiwat Chawannakul
a35bc8fe7a Fix stale object causing a panic on DELETE event
Kubernetes-commit: 1f4f78ac414b7a1666e908670c5e447015bdc6b9
2021-01-06 10:38:31 -08:00
Kubernetes Publisher
9761a13537 Merge pull request #96906 from Rajalakshmi-Girish/issue-96853
Fixes the unit tests to be more tolerant with error messages

Kubernetes-commit: 10c1c3acf65cfb00de7fa28f784865bd42ab4872
2021-01-06 05:04:32 +00:00
Kubernetes Prow Robot
0d3f257a17
Merge pull request #907 from munnerz/patch-1
README: add 1.20 in compatibility matrix
2021-01-05 02:33:59 -08:00
Kubernetes Publisher
e9d996dae2 Merge pull request #97326 from victor-timofei/deltafifo-doc
Update DeltaFIFO documentation and group Delta definitions to the top of the file

Kubernetes-commit: 9406e145c25e4c3041ec82529176957f164fdb08
2020-12-29 09:00:12 +00:00
Victor Timofei
53a09c71a4 Update the wording of the DeltaFIFO
Kubernetes-commit: 3a107951f0bf16a022b70a667c98833e4ac1d540
2020-12-24 16:33:04 +02:00
Kubernetes Publisher
0964d4be75 Merge pull request #97033 from patrickshan/pshan/bump/Azure/go-autorest/autorest
Bump github.com/Azure/go-autorest/autorest to v0.11.12

Kubernetes-commit: e11e9d4c6c3f522ed398748a11cc5dd1f8949c2b
2020-12-17 08:59:40 +00:00
Kubernetes Publisher
2b31242e93 Merge pull request #94813 from dramich/nometrics
Don't start goroutine for noMetrics

Kubernetes-commit: c4aca30005dacca3f768e511f3e424893161558d
2020-12-17 01:02:20 +00:00
James Munnelly
efbc7082a8
README: add 1.20 in compatibility matrix 2020-12-16 15:26:15 +00:00
Kubernetes Publisher
cc9d424da8 Merge pull request #96883 from pacoxu/fix/96862
fix index test: multi index check for empty list

Kubernetes-commit: 46d481b4556e3328758eeb851920e2536a488658
2020-12-16 04:59:30 +00:00
Victor Timofei
710a222444 Move Delta definitions to the top
Kubernetes-commit: bcc1c9a387c898478ed47c629864418be89bf518
2020-12-15 22:07:33 +02:00
Victor Timofei
09cf7147ab Update DeltaFIFO Documentation
Kubernetes-commit: 1a4ed5ea57ac4d562311d2b2852dcc59b78725da
2020-12-15 21:31:30 +02:00
Kubernetes Publisher
77dfe4dff7 Merge pull request #92138 from ash2k/ash2k/client-cleanups
Client library cleanups

Kubernetes-commit: 667deec758fbbd9576df1c5f081a4e239996b074
2020-12-10 21:00:11 +00:00
Kubernetes Publisher
62f63bbbfe Merge pull request #96837 from adamzhoul/master
fix  remotecommand stream blocked forever problems.

Kubernetes-commit: ccd29ea264535fa2ef36cf4dfb004fed99c99fbf
2020-12-10 05:00:18 +00:00
Patrick Shan
01fbb1db89 Bump github.com/Azure/go-autorest/autorest to v0.11.12
Kubernetes-commit: c75d9906587a8b174338e0ffe725759f68c0be56
2020-12-03 15:38:17 +11:00
Maciej Szulik
61675820ec Generated changes
Kubernetes-commit: 7d9f36cd850cfc080d8598ff4eac7b6fa3efc27d
2020-12-01 16:34:55 +01:00
Maciej Szulik
d6cefbd7a0 Drop batch/v2alpha1 API
Kubernetes-commit: 3dab7462d1ff6e20f7efe38249dd9958e4e32c89
2020-12-01 16:33:47 +01:00
Rajalakshmi-Girish
cb8d3d1111 fixes the unit tests to be more tolerant with error messages
Kubernetes-commit: 98948ad8092b41ebc08d50aa557b2d7ba5496e7d
2020-11-27 08:21:56 +00:00
pacoxu
8031d76bd6 fix index test: multi index check for empty list
Signed-off-by: pacoxu <paco.xu@daocloud.io>

Kubernetes-commit: ae6360f6c732d554c332a0bc1b99808149d8376e
2020-11-26 18:23:57 +08:00
adamzhoul
04adad44d6 fix spdy stream, conn deadlock.
Kubernetes-commit: 94a297485bf39a6d69f316c257d351e9432b8cb5
2020-11-15 17:06:34 +08:00
Kubernetes Publisher
e24efdc77f Merge pull request #96797 from jqmichael/initialCountLength
Fixed a bug where initialPopulationCount should be based on the key length not list size in DeltaFIFO#Replace()

Kubernetes-commit: 7d8587c4cc3529dc9065c1536071ea382e6c725c
2020-12-09 05:00:23 +00:00
Kubernetes Publisher
50c086135a Merge pull request #96643 from bboreham/lose-timestamp
Remove unused argument from generateEvent

Kubernetes-commit: e3bf0cc4ae836dd27bb01a5e426cb50721f63211
2020-12-09 05:00:20 +00:00
Qing Ju
1d175299a2 Fixed a harmless bug where initialPopulationCount should be based on the key length not list size in DeltaFIFO#Replace()
Kubernetes-commit: bc39672c0638426979feef95baeff39d170161eb
2020-11-22 16:35:19 -08:00
Kubernetes Publisher
fb61a7c88c Merge pull request #96720 from liggitt/throttled-logger
Deflake ThrottledLogger test

Kubernetes-commit: 2ea6828ea0803e188a6a7c4a6581f522865ae8f3
2020-11-21 00:58:59 +00:00
Jordan Liggitt
61471be615 Deflake ThrottledLogger test
Kubernetes-commit: c84df5d66ea8d949374b67c5205b9869b984ea84
2020-11-19 13:59:27 -05:00
Kubernetes Publisher
66db254099 Merge pull request #95981 from caesarxuchao/http2-healthcheck
Enables HTTP/2 health check

Kubernetes-commit: afeac926fa79179bfd0c5e718459086845a2a80c
2020-11-18 00:58:04 +00:00
Kubernetes Publisher
7c9ea22f76 Merge pull request #92743 from liggitt/gc
Fix GC uid races and handling of conflicting ownerReferences

Kubernetes-commit: e1ab99e0d662f3d9bf89ccf48f71444dbabce37e
2020-11-17 12:14:06 -08:00
Bryan Boreham
5d2c89de53 Remove unused argument from generateEvent
Kubernetes-commit: beceee68156dff8b10123a37bb4645941b7df0c2
2020-11-17 16:51:10 +00:00
xiongzhongliang
d7ba1f2e01 use klog.Info and klog.Warning when had no format
Kubernetes-commit: 90f4aeeea4cc5f96caa6ed87c67ca7e62d1ba21c
2020-11-14 00:55:06 +08:00
Chao Xu
8dde295de4 Add a unit test testing the HTTP/2 health check help the REST client
detects broken TCP connections.

Kubernetes-commit: ba7b1f7a89ffed78115ab0229b7504d05f6c7d48
2020-10-29 23:03:14 -07:00
Solly Ross
726d27fe7a Don't record events in goroutines
This changes the event recorder to use the equivalent of a select
statement instead of a goroutine to record events.

Previously, we used a goroutine to make event recording non-blocking.
Unfortunately, this writes to a channel, and during shutdown we then
race to write to a closed channel, panicing (caught by the error
handler, but still) and making the race detector unhappy.

Instead, we now use the select statement to make event emitting
non-blocking, and if we'd block, we just drop the event.  We already
drop events if a particular sink is overloaded, so this just moves the
incoming event queue to match that behavior (and makes the incoming
event queue much longer).

This means that, if the user uses `Eventf` and friends correctly (i.e.
ensure they've returned by the time we call `Shutdown`), it's
now safe to call Shutdown.  This matches the conventional go guidance on
channels: the writer should call close.

Kubernetes-commit: e90e67bd002e70a525d3ee9045b213a5d826074d
2020-10-16 15:05:00 -07:00
Jordan Liggitt
c476b49dcf Add GC unit tests
Adds unit tests covering the problematic scenarios identified
around conflicting data in child owner references

                      Before   After
package level         51%      68%
garbagecollector.go   60%      75%
graph_builder.go      50%      81%
graph.go              50%      68%

Added/improved coverage of key functions that had lacking unit test coverage:

* attemptToDeleteWorker
* attemptToDeleteItem
* processGraphChanges (added coverage of all added code)

Kubernetes-commit: e491c3bc7056530d82590d95f0af0e8c4d8dded5
2020-10-09 17:50:52 -04:00
Kubernetes Publisher
77eda6a939 Merge pull request #96317 from Jefftree/test-ssa
Integrate defaults marker to defaulter-gen

Kubernetes-commit: 05d1b94a701d807666b40665f5728e0cc5f92054
2020-11-14 08:57:41 +00:00
Kubernetes Publisher
76f48268c7 Merge pull request #96527 from adtac/apfbeta
promote API priority and fairness types and APIs to beta

Kubernetes-commit: 36f571404fcb136011024b89efaa2a0d089acd5f
2020-11-14 04:57:47 +00:00
Kubernetes Publisher
4ab8fb4585 Merge pull request #96425 from bobbypage/vendor-cadvisor-v0.38
Vendor cadvisor v0.38.4

Kubernetes-commit: 41533ecec8966636554faba44368a36d5d6c5347
2020-11-14 00:58:07 +00:00
David Porter
4bbb204f15 vendor: cadvisor v0.38.4
Kubernetes-commit: 8af7405f1730c4913c48c6dc494e319cb3015f69
2020-11-13 19:52:57 +00:00