Commit Graph

3416 Commits

Author SHA1 Message Date
Madhav Jivrajani
b9fa896d5d Refactor client-go/util/flowcontrol/throttle.go RateLimiter
- Introduce PassiveRateLimiter which implements all methods of previous RateLimiter except Accept() and Wait()
- Change RateLimiter interface to extend PassiveRateLimiter by additionally implementing Accept() and Wait()
- Make client-go/tools/record use PassiveRateLimiter

Refactor EventSourceObjectSpamFilter, EventAggregator, EventCorrelator

- EventSourceObjectSpamFilter, EventAggregator, EventCorrelator use clock.PassiveClock now.
	- This won't be a breaking change because even if a clock.Clock is passed, it still implements the clock.PassiveClock interface.
- Extend clock.PassiveClock through Clock.
- Replace pacakge local implementation of realClock with clock.RealClock
- In flowcontrol/throttle.go split tokenBucketRateLimiters to use Clock and clock.PassiveClock.
- Migrate client-go/tools/record tests from using IntervalClock to using SimpleIntervalClock (honest implementation of clock.PassiveClock)

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: ac5c55f0bd853fcf883d9b8e1f5ef728a2fb5309
2021-08-25 21:56:26 +05:30
scott
0c4682e956 explain the reason why metaclient special processing metav1.DeleteOptions encoding
metaclient explicitly specifies the Content-Type when executing Delete and DeleteCollection, and add test for that

Kubernetes-commit: 8976f6f6d9af22ad40df891565c19e4dfd67f591
2021-08-25 17:55:25 +08:00
Kubernetes Publisher
3dc80a3333 Merge pull request #103692 from justaugustus/go117
[go1.17] Update to go1.17

Kubernetes-commit: c1e69551be1a72f0f8db6778f20658199d3a686d
2021-08-25 04:07:38 +00:00
Shiming Zhang
6e9eb81c44 Check namespaces match in UpdateWithEventNamespace
Kubernetes-commit: 0f2e202ff4f3cca1c068792f6eb79b48cf3c9bf9
2021-08-23 10:36:29 +08:00
Abu Kashem
0c0d853c0f apf: regenerate for v1beta2
Kubernetes-commit: 2f19f8c2df640b6c6bf00c97752053b9b0a7f09b
2021-08-16 17:07:24 -04:00
Stephen Augustus
624e6827e6 generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 481cf6fbe753b9eb2a47ced179211206b0a99540
2021-08-12 17:13:11 -04:00
scott
61ae14a896 set the content-type Header when the dynamic client sends the request
Kubernetes-commit: 2ad09c6a87b9150598c6119d653acc983c5c7a11
2021-08-12 20:17:07 +08:00
Stephen Augustus
484a294726 generated: Run hack/lint-dependencies.sh and hack/update-vendor.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 0be115722bf30f42c7a954d5cdd4b48efd70ae77
2021-08-11 18:03:39 -04:00
Stephen Augustus
e311efc923 [go1.17] Bump golang.org/x/... dependencies
hack/pin-dependency.sh golang.org/x/crypto master
hack/pin-dependency.sh golang.org/x/net master
hack/pin-dependency.sh golang.org/x/oauth2 master
hack/pin-dependency.sh golang.org/x/sync master
hack/pin-dependency.sh golang.org/x/sys master
hack/pin-dependency.sh golang.org/x/term master
hack/pin-dependency.sh golang.org/x/time master
hack/pin-dependency.sh golang.org/x/tools master

Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 0e9881a9dc9d06aaf93723b4dfc7f4e1cb92e215
2021-08-11 18:02:07 -04:00
Kubernetes Publisher
b1403d113a Merge pull request #104504 from astraw99/fix_typo_CRED
Fix typo `CRED` to `CRUD`

Kubernetes-commit: 62828b24f35cb27e871755a2c201b91ce9ff7de0
2021-08-24 16:07:36 +00:00
astraw99
f100d86401 fix typo CRED to CRUD
Kubernetes-commit: f8b82e189cfdc3aca7b9d789cc6f3131897f0ebc
2021-08-22 21:19:30 +08:00
Kubernetes Publisher
590eaed90a Merge pull request #104373 from astraw99/fix_typo_rate_limiter
Fix typo of rate limiter

Kubernetes-commit: 40f05cec281bca57b898c3bf629dbc056eccf3da
2021-08-20 20:07:23 +00:00
Kubernetes Publisher
e88163c224 Merge pull request #104368 from aojea/ruleguard
golang 1.17 fails to parse IPs with leading zeros

Kubernetes-commit: b0bc8adbc2178e15872f9ef040355c51c45d04bb
2021-08-20 16:06:55 +00:00
Antonio Ojea
a6edfabde7 run hack/update-netparse-cve.sh
Kubernetes-commit: 0cd75e8fec62a2531637e80bb950ac9983cac1b0
2021-08-20 01:16:14 +02:00
Kubernetes Publisher
9c45b4b2bf Merge pull request #104466 from stbenjam/bump-utils
vendor: bump k8s.io/util to get fix for LRU cache

Kubernetes-commit: 7fcecc077dae36071901472d12fa26e5af99010c
2021-08-20 04:06:59 +00:00
Stephen Benjamin
284a0d5a73 vendor: bump k8s.io/util to get fix for LRU cache
This updates the k8s.io/util to pull in the fix for
https://github.com/kubernetes/kubernetes/issues/104452.

Commands run:

  ./hack/pin-dependency.sh k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a
  ./hack/update-vendor.sh

Kubernetes-commit: c2532351525c2822daab61303eb4f94942a017e6
2021-08-19 17:11:35 -04:00
Kubernetes Publisher
2961e1de2c Merge pull request #104413 from liggitt/openapi-ipvalidation
Bump k8s.io/kube-openapi

Kubernetes-commit: cde45fb161c5a4bfa7cfe45dfd814f6cc95433f7
2021-08-17 20:07:04 +00:00
Jordan Liggitt
d2b8b64fb6 Regenerate applyconfigurations
Kubernetes-commit: 5e03a1f070ec0556fd6a809026efcdddb4026c8c
2021-08-17 11:41:47 -04:00
Jordan Liggitt
a3cb704425 Bump k8s.io/kube-openapi
Updates to preserve openapi ipv4 validation compatibility with pre-go1.17 behavior

Kubernetes-commit: b15c2130aad497add782820c415c59952b4e75a8
2021-08-17 10:13:40 -04:00
astraw99
9d15ff74ca fix typo of rate limiter
Kubernetes-commit: 7953cf0ce9f890b6cba7de3325a7ce68609832a0
2021-08-15 17:48:37 +08:00
Kubernetes Publisher
d6c83109f0 Merge pull request #103912 from Iceber/fix-event-recorder
client-go/events: avoid referencing a nil related object

Kubernetes-commit: e7efe219f8a5fcdff9647d45639696048c1f6147
2021-08-12 12:05:55 +00:00
Kubernetes Publisher
19db02e788 Merge pull request #103918 from olagacek/master
Allow customizing spam filtering in event client library

Kubernetes-commit: 582c6f6df71d8c59de5b8b5a2363d13ffcc42b14
2021-08-11 16:06:03 +00:00
Kubernetes Publisher
044192f4ee Merge pull request #104279 from liggitt/add-staging-golang-license
Copy golang license to staging copies

Kubernetes-commit: 5a732dcfe1d4ec0e8ee2871b106605b7f8a69b98
2021-08-11 04:05:56 +00:00
Kubernetes Publisher
81fcb4fde1 Merge pull request #104258 from coderanger/patch-3
Typo in a comment.

Kubernetes-commit: 01f83db11942d0dd8f30658a505c440404fa5d44
2021-08-11 04:05:55 +00:00
Jordan Liggitt
21ff407b62 Copy golang license to staging copies
Kubernetes-commit: c4ecdad5708262d5be1d6cce4cbad3a3b820924b
2021-08-10 17:37:28 -04:00
Noah Kantrowitz
e89f211c9a Typo in a comment.
Kubernetes-commit: 86c6e25016a3385394503efc9bb29f4dfe79163c
2021-08-09 21:21:45 -07:00
Kubernetes Publisher
150ce54105 Merge pull request #102913 from pacoxu/upgrade-promotheus-common
upgrade prometheus/common to v0.28.0

Kubernetes-commit: 4b4d12f8a68e224c78d00e8fd2bf3c87aff90a9a
2021-08-09 16:05:56 +00:00
astraw99
a9a86ad864 unify worker num to workers
Kubernetes-commit: e6df935fd30c56a8ece0da6152c60fc725d942b7
2021-08-09 10:48:53 +08:00
Kubernetes Publisher
b7569257b2 Merge pull request #102872 from barkbay/client/fix-discovery-error
Return StatusError 404 in fake client when resource is not found

Kubernetes-commit: f8023d60f2c30836154e7f7a294cfbe9eb8d3e8a
2021-08-06 20:17:05 +00:00
Kubernetes Publisher
0f5acb8c39 Merge pull request #103917 from aojea/slow_handlers
client-go: deltaFIFO trace slow handlers

Kubernetes-commit: ec663ada4be14d0afd45e0414b8711d4380ec289
2021-08-06 00:06:00 +00:00
atiratree
496c390182 revert "fix wrong output when using jsonpath"
This partially reverts commit 39cfe232325d66bcdbc935af7aaf7022562e7010and PR #98057

the original problem was caused by not using {end} at the end of the range

Kubernetes-commit: 5c3de9f1de913d1251ce2183991a845edc01d123
2021-08-05 18:39:43 +02:00
Kubernetes Publisher
fa98c04850 Merge pull request #103657 from dgrisonnet/fix-event-doc
Update Events version in the documentation of the events package

Kubernetes-commit: 7e99f3d7490d11438b9834a7bd6b0e8b7eb0bec1
2021-08-05 08:05:52 +00:00
Kubernetes Publisher
2d8e761048 Merge pull request #103564 from kevindelgado/unstr-extr-poc
ExtractItems for unstructured apply configurations

Kubernetes-commit: 0a704f9e1f6685f3ae39114435d23593a900e74c
2021-08-05 08:05:51 +00:00
Kubernetes Publisher
3c86d4a920 Merge pull request #100406 from tomkukral/retry-doc
fix typo in retry doc

Kubernetes-commit: bf22025950c0af15f3bbf92f3ff085dbe5b087a7
2021-08-05 04:05:53 +00:00
Patrick Ohly
90bee32800 klog 2.20.0, logr v1.1.0, zapr v1.1.0
This replaces the experimental logr v0.4 with the stable v1.1.0
release. This is a breaking API change for some users because:
- Comparing logr.Logger against nil is not possible anymore:
  it's now a struct instead of an interface. Code which
  allows a nil logger should switch to *logr.Logger as type.
- Logger implementations must be updated in lockstep.

Instead of updating the forked zapr code in json.go, directly using
the original go-logr/zapr is simpler and avoids duplication of effort.

The updated zapr supports logging of numeric verbosity. Error messages
don't have a verbosity (= always get logged), so "v" is not getting
added to them anymore.

Source code logging for panic messages got fixed so that it references
the code with the invalid log call, not the json.go implementation.

Finally, zapr includes additional information in its panic
messages ("zap field", "ignored key", "invalid key").

Kubernetes-commit: cb6a65377775110631bc865acc06c3f957592813
2021-08-03 17:31:39 +02:00
Margo Crawford
e0129e64d4 Introduces Impersonate-Uid to client-go.
* Updates ImpersonationConfig in rest/config.go to include UID
  attribute, and pass it through when copying the config
* Updates ImpersonationConfig in transport/config.go to include UID
  attribute
* In transport/round_tripper.go, Set the "Impersonate-Uid" header in
  requests based on the UID value in the config
* Update auth_test.go integration test to specify a UID through the new
  rest.ImpersonationConfig field rather than manually setting the
  Impersonate-Uid header

Signed-off-by: Margo Crawford <margaretc@vmware.com>

Kubernetes-commit: d9ddfb26e10ee353fc4617b66d2c9274bf6d1c08
2021-07-30 15:50:51 -07:00
ravisantoshgudimetla
aade4d8106 api: Promote statefulset MinReadySeconds to beta
Kubernetes-commit: bcc288eeeeaa34083319f9a27a352b98d4e6b3d8
2021-07-30 12:38:14 -04:00
Tim Hockin
bcf88f084d Update golang.org/x/time/rate (#104014)
* Add failing test case

* Update golang.org/x/time/rate

* Call update-internal-modules from update-vendor

Kubernetes-commit: 09dc055984e9532f29f37acae7aea7a979ded764
2021-07-30 02:27:36 +00:00
Kevin Delgado
dfebd379cf fix boilerplate and staticcheck
Kubernetes-commit: 3628065b455f17cf3da5a5021c9603f89daf20bc
2021-07-27 22:31:38 +00:00
Kevin Delgado
ba2f26324b fix vendor
Kubernetes-commit: 85bc3c4f857090899e82eb2c7c3f6aebc9f4eeaf
2021-07-27 21:23:49 +00:00
Kevin Delgado
d4454993f4 remove apiserver impor from client-go
Kubernetes-commit: af11c4ac9be74115dfd35ce6f18cfa0440fc3458
2021-07-27 20:46:40 +00:00
Kevin Delgado
10ec231914 wrap extractor errors
Kubernetes-commit: 479e2ae307c0ca7e0a826e54df6bcc7676445e35
2021-07-27 01:25:03 +00:00
Aleksandra Gacek
23071d64f0 Allow customizing spam filtering in event client library
Kubernetes-commit: 00080d400fe27f11795b654ad1e124311831a0fc
2021-07-26 16:05:18 +02:00
Antonio Ojea
c63d830a92 client-go: deltaFIFO trace slow handlers
If the informers handlers are slow processing the objects, the deltaFIFO
blocks the queue and the streamWatchers can not add new elements to the
queue, creating contention and causing different problems, like high
memory usage.
The problem is not easy to identify from a user perspective, typically
you can use pprof to identify a high memory usage on the StreamWatchers
or some handler consuming most of the cpu time, but users should not
have to profile the golang binary in order to know that.

Metrics were disabled on the reflector because of memory leaks, also
monitoring the queue depth can't give a good signal, since it never goes high

However, we can trace slow handlers and inform users about the problem.

Kubernetes-commit: d38c2df2c4b945bcf1f81714fc6bfd01bbd0f538
2021-07-26 16:00:31 +02:00
Iceber Gu
3e35ef93c0 client-go/events: avoid referencing a nil related object
Kubernetes-commit: 822eb29b6f333317798e5b88fc43fb28b5f33b69
2021-07-26 18:15:22 +08:00
Mikhail Mazurskiy
0ae31f68fd Cache rest mapper and discovery client
They are both stateful so it is beneficial for performance to cache them.

Kubernetes-commit: 037ed11f649f356efc4363db32b9f85ef02ca106
2021-07-25 19:31:58 +10:00
Kevin Delgado
b5bb80748a Revert caching in favor of simple ttl
Kubernetes-commit: 1122091b065b5ce37a93b1048174acaff243bf74
2021-07-21 22:57:57 +00:00
Kevin Delgado
784e3fbb2f remove commented out code
Kubernetes-commit: 53582a0104fb88aacb5f9512e60136e59fc25f8c
2021-07-20 21:59:37 +00:00
Kevin Delgado
305b0bc3db Address PR feedback around gvk parser generation ergonomics
Kubernetes-commit: c9e97de46bb76cf868fcb172f286127b9894fbe9
2021-07-20 21:29:02 +00:00
Kubernetes Publisher
ac207faedf Merge pull request #103747 from mattcary/noapi
Revert #99378

Kubernetes-commit: 7303b2ce4e0de8d97e677eee880fa12b4d4939c1
2021-07-20 14:27:25 +00:00