Commit Graph

3752 Commits

Author SHA1 Message Date
Odin Ugedal
b250bf51ae client-go/cache: merge ReplaceMakesDeletionsForObjectsInQueue tests
Signed-off-by: Odin Ugedal <ougedal@palantir.com>
Signed-off-by: Odin Ugedal <odin@uged.al>

Kubernetes-commit: cd3e98b65c1339a8adc157175630de099a057d3f
2023-02-10 14:30:10 +00:00
Odin Ugedal
8279635aa4 client-go/cache: fix missing delete event on replace without knownObjects
This fixes an issue where a relist could result in a DELETED delta
with an object wrapped in a DeletedFinalStateUnknown object; and then on
the next relist, it would wrap that object inside another
DeletedFinalStateUnknown, leaving the user with a "double" layer
of DeletedFinalStateUnknown's.

Signed-off-by: Odin Ugedal <ougedal@palantir.com>
Signed-off-by: Odin Ugedal <odin@uged.al>

Kubernetes-commit: 0bf0546d9f75d92c801e81c9f7adf040bba64102
2023-02-10 14:16:26 +00:00
Odin Ugedal
2ded6b6eb8 client-go/cache: fix missing delete event on replace
This fixes a race condition when a "short lived" object
is created and the create event is still present on the queue
when a relist replaces the state. Previously that would lead in the
object being leaked.

The way this could happen is roughly;

1. new Object is added O, agent gets CREATED event for it
2. watch is terminated, and the agent runs a new list, L
3. CREATE event for O is still on the queue to be processed.
4. informer replaces the old data in store with L, and O is not in L
  - Since O is not in the store, and not in the list L, no DELETED event
    is queued
5. CREATE event for O is still on the queue to be processed.
6. CREATE event for O is processed
7. O is <leaked>; its present in the cache but not in k8s.

With this patch, on step 4. above it would create a DELETED event
ensuring that the object will be removed.

Signed-off-by: Odin Ugedal <ougedal@palantir.com>
Signed-off-by: Odin Ugedal <odin@uged.al>

Kubernetes-commit: 25d77218acdac2f793071add9ea878b08c7d328b
2023-02-08 14:57:23 +00:00
Kubernetes Publisher
df55688a24 Merge pull request #115604 from pacoxu/fix-design-proposals-links
old design proposals are now moved to Design Proposals Archive repo

Kubernetes-commit: ffe410bbb4e43ba7b7ceaec379709575e817d866
2023-02-16 21:05:13 +00:00
Paco Xu
4bd9226d28 API docs: point to current docs instead of archived designs
Kubernetes-commit: 3d536bd14bba0586f20d1d96560073e5d9e82f97
2023-02-16 15:29:56 +08:00
Kubernetes Publisher
60f5c9b463 Merge pull request #115786 from liggitt/net-0.7.0-master
Update golang.org/x/net to v0.7.0

Kubernetes-commit: b3d8ac8496a23d65a907f9333d906bcd5463764e
2023-02-15 10:47:27 +00:00
Kubernetes Publisher
249eb86644 Merge pull request #115785 from liggitt/fix-kubectl-test
Revert "Refactor fake versions of openapi client into testing subdir"

Kubernetes-commit: 98406e2a3e88bd6a2affe5674b7a577aa0926d48
2023-02-14 21:26:39 -08:00
Jordan Liggitt
e850f4518c Update golang.org/x/net to v0.7.0
Kubernetes-commit: f8e00778ddca11c08117ccf1d1c410641c70c428
2023-02-14 23:14:30 -05:00
Jordan Liggitt
fb55d97d70 Revert "Refactor fake versions of openapi client into testing subdir"
This reverts commit 869da89eab37ce670759cea2c86325f36625e7fc.

Kubernetes-commit: f98944590058f936c7adb76ea2c974899a460fe2
2023-02-14 22:14:37 -05:00
Kubernetes Publisher
278918a593 Merge pull request #115465 from seans3/openapi-client-testing
Refactor fake versions of openapi client into testing subdir

Kubernetes-commit: 08bbecb8e315fc976e35575e4e33c8a4a0e1cd28
2023-02-15 06:24:06 +00:00
Kubernetes Publisher
8ef4d7d4e8 Merge pull request #115685 from skitt/rest-req-error
client-go: add an Error() function on Request

Kubernetes-commit: 30f15671456283f37c3ed09412299b27cb92bcb4
2023-02-13 14:53:41 -08:00
Stephen Kitt
22e2a9b6b1 client-go: add an Error() function on Request
Requests can accumulate errors with no obvious indication, e.g. if
their primary purpose is to construct a URL: URL() itself doesn't
return an error if r.err is non-nil.

Instead of changing URL() to return an error, which has quite a large
impact, add an Error() function and indicate on URL() that it should
be checked.

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: f69c1c47463ff70ad61adf6f38c4d5b7373e9d0a
2023-02-10 14:44:07 +01:00
Kubernetes Publisher
d46293369e Merge pull request #115665 from aramase/aramase/f/update_vendor_k8s_utils
Update k8s.io/utils to `a36077c30491`

Kubernetes-commit: 9a51625ebebcc8345c851afc2b5cc98eb19ac193
2023-02-10 01:08:12 +00:00
Anish Ramasekar
86a4c64374 Update k8s.io/utils to a36077c30491
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: 09e02052fdf3d248368b3d05d5c922d616528c4c
2023-02-09 20:09:41 +00:00
Kubernetes Publisher
efd0415f67 Merge pull request #115514 from pohly/event-broadcaster-shutdown
client-go: don't wait too long after EventBroadcaster.Shutdown

Kubernetes-commit: b0171f77f68427813efbb478c0ba89f48322d34a
2023-02-08 13:07:28 +00:00
Paco Xu
878a4f8bbe archived design proposals are now moved to Design Proposals Archive Repo.
Kubernetes-commit: 019d2615af3f7fd0ed0d593ef9df348f6d85b204
2023-02-08 11:12:22 +08:00
Kubernetes Publisher
00b9d76f44 Merge pull request #115315 from enj/enj/i/kas_kubelet_conn_close
kubelet/client: collapse transport wiring onto standard approach

Kubernetes-commit: 22b88dea360b0aae4ecaa57142718386b3cbd40d
2023-02-07 17:07:30 +00:00
Kubernetes Publisher
9c5046523c Merge pull request #115379 from artemvmin/serial-mkfs
Add an option to limit the number of concurrent mkfs calls

Kubernetes-commit: 6eb008620cd0ee3501326ee003d47fbaf1fa5b52
2023-02-07 05:07:29 +00:00
Kubernetes Publisher
2e3265cc1d Merge pull request #108396 from tkashem/retry-metric
client-go: add a metric to count request retries

Kubernetes-commit: 2ab3151936f1df6b3ffb4d49bf9dc90218264545
2023-02-07 05:07:26 +00:00
Monis Khan
d8b14dc089 kubelet/client: collapse transport wiring onto standard approach
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: 754cb3d601a820180d19567c3600a789d77b0f07
2023-02-05 20:51:54 -05:00
Artem Minyaylov
13c89f7a54 Update k8s.io/utils to latest version
Update all usages of FakeExec to pointer to avoid copying the mutex

Kubernetes-commit: f573e149423dc578284789fdff8eeb3c195b5ccf
2023-02-03 14:51:25 -08:00
Patrick Ohly
f6a5a1f139 client-go: don't wait too long after EventBroadcaster.Shutdown
When Shutdown was called, delivery of each pending event would still be retried
12 times with a delay of ~10s between each retry. In apiserver integration
tests that caused the goroutine to linger long after the corresponding
apiserver of the test was shut down.

Kubernetes-commit: 15b01af9c18a0840d71e2bb7dff4d8c29b158aad
2023-02-03 14:52:20 +01:00
Sean Sullivan
bb1833cfed Refactor fake versions of openapi client into testing subdir
Kubernetes-commit: 869da89eab37ce670759cea2c86325f36625e7fc
2023-02-01 18:39:18 -08:00
Abu Kashem
d2388d199c client-go: add metric to count retries
Kubernetes-commit: b6c369f5c90bbef8058b3d44949f4e815dd6607f
2022-02-28 12:22:09 -05:00
Kubernetes Publisher
f457a57d6d Merge pull request #112072 from tkashem/retry-concurrency-test
client-go: add unit test for Request thread safety

Kubernetes-commit: 87759c73eb7d7804c8b5116becbce3f1066678bd
2023-01-31 01:46:49 -08:00
Abu Kashem
67f1485c1d client-go: add unit test for Request thread safety
Kubernetes-commit: ca492a9b62a586caf3e3cd22bc020108a63fb395
2022-08-26 13:24:36 -04:00
Kubernetes Publisher
b1350830d0 Merge pull request #115266 from pohly/gomega-update
dependencies: update gomega to v1.26.0

Kubernetes-commit: 6d17cb2051b3a9958ed3353df242312d85e75d43
2023-01-30 21:07:00 +00:00
Kubernetes Publisher
d7d6bcf014 Merge pull request #115354 from pohly/dra-reserved-for-list-type
dynamic resource allocation: avoid apiserver complaint about list content

Kubernetes-commit: c829397f7a1fa956766f6479a8ca454b6937feda
2023-01-30 17:06:56 +00:00
Kubernetes Publisher
648d82831a Merge pull request #110253 from tkashem/retry-condition-test
client-go: add a test to document retry conditions

Kubernetes-commit: 3bf42a7aec041f4e50e7b4ce3b3cfe04de0af859
2023-01-27 09:14:48 +00:00
Patrick Ohly
fa4e59aaee dynamic resource allocation: avoid apiserver complaint about list content
This fixes the following warning (error?) in the apiserver:

E0126 18:10:38.665239   16370 fieldmanager.go:210] "[SHOULD NOT HAPPEN] failed to update managedFields" err="failed to convert new object (test/claim-84; resource.k8s.io/v1alpha1, Kind=ResourceClaim) to smd typed: .status.reservedFor: element 0: associative list without keys has an element that's a map type" VersionKind="/, Kind=" namespace="test" name="claim-84"

The root cause is the same as in e50e8a0c919c0e02dc9a0ffaebb685d5348027b4:
nothing in Kubernetes outright complains about a list of items where the item
type is comparable in Go, but not a simple type. This nonetheless isn't
supposed to be done in the API and can causes problems elsewhere.

For the ReservedFor field, everything seems to work okay except for the
warning. However, it's better to follow conventions and use a map. This is
possible in this case because UID is guaranteed to be a unique key.

Validation is now stricter than before, which is a good thing: previously,
two entries with the same UID were allowed as long as some other field was
different, which wasn't a situation that should have been allowed.

Kubernetes-commit: 508cd60760567b3832da748140e3cf782c1b8695
2023-01-26 20:37:00 +01:00
Patrick Ohly
55c90d535e dependencies: update gomega to v1.26.0
If gomega.Eventually/Consistently run into a situation where it observes some
state of e.g. a pod which does not satisfy the condition and then further
polling fails with API server errors, gomega will report both the most recent
pod state and API error instead of just the API error.

Kubernetes-commit: aa1279b5eb79177f5351368d8d9159982b1bfb5e
2023-01-23 15:19:38 +01:00
Abu Kashem
79c4b4060a client-go: add test to document retry conditions
Kubernetes-commit: 68c542d52246b0b750e332616884350164018695
2022-05-27 09:13:30 -04:00
Kubernetes Publisher
adb1f506f9 Merge pull request #114550 from alexzielenski/apiserver/smd/update-kube-openapi
update kube-openapi dependency

Kubernetes-commit: df03edaf755f71a61f4f817ca374ebe3b6416270
2023-01-25 05:06:36 +00:00
Alexander Zielenski
1c9d8a00ef update kube-openapi
Kubernetes-commit: 7641ff75412c1d8b547c4fa388d3901aeeda6948
2023-01-23 15:32:33 -08:00
Kubernetes Publisher
cbb60162c0 Merge pull request #111652 from ash2k/ash2k/leader-elector-tweaks
Always emit the stopped leading event

Kubernetes-commit: f21c60341740874703ce12e070eda6cdddfd9f7b
2023-01-23 13:06:19 +00:00
Mikhail Mazurskiy
ac40ba3297 Always emit the stopped leading event
Kubernetes-commit: 771ab7488d53f0d6c85238992a8e5f4bcb73e24e
2022-10-12 20:53:05 +11:00
Kubernetes Publisher
84ad8a7920 Merge pull request #113540 from wongearl/cleanup-client-go
diff.ObjectReflectDiff is DEPRECATED use cmp.Diff

Kubernetes-commit: 60d73ba75148483d150622a4d8b6e122e189ceab
2023-01-19 21:09:35 +00:00
Kubernetes Publisher
7059973891 Merge pull request #115186 from thockin/codegen-2-rm-deprecated-clients
Remove deprecated and orphaned generated code

Kubernetes-commit: 2fba771792023756b539501cdabdb19a32bb9536
2023-01-19 21:09:34 +00:00
Kubernetes Publisher
31586e6042 Merge pull request #115184 from thockin/codegen-1-clientset-doc-go
Don't generate clientset/doc.go in client-gen

Kubernetes-commit: c2d18a6d14974b123d09c4ce40ea0dd79184787d
2023-01-19 04:13:56 +00:00
Kubernetes Publisher
c33df1cccb Merge pull request #113637 from mikedanese/http-proxy
switch spdy round trip tests to simple http proxy

Kubernetes-commit: 0acf6dbf7c094b71291b9fd7f78d5385565aa97c
2023-01-19 00:27:41 +00:00
Tim Hockin
7c57428f98 Remove obsolete generated listers
These are not regenerated by any input.  The OWNERS files were the last
things left for these 2 directories

Kubernetes-commit: dc88f34ce30eb98285f7f30e391b135e842cdbc2
2023-01-14 17:54:12 -08:00
Tim Hockin
0f17f43973 Remove obsolete generated applyconfigs
These are not regenerated by any input.

Kubernetes-commit: 37ca6b0fac3c118c9cb0619a07a2fe40e567f6d1
2023-01-14 17:20:06 -08:00
Tim Hockin
1d637ff29e Don't generate clientset/doc.go in client-gen
It seems valuable to be able to provide hand-written docs for these
first-level directories, and if don't want them, the generated doc.go
files are not actually very helpful.

This commit also adds new doc.go files for client-go listers/ and
informers/.

Kubernetes-commit: 95bf7b0afe9dd6a0f00125b1d290514a23e778e2
2023-01-12 09:51:33 -08:00
Tim Hockin
b94c7fc493 Fix client-go doc.go - not generated
As per liggitt, lavalamp, and jpbetz

Kubernetes-commit: f95a840c12ef24615d1069b98dca8a061c710cbb
2023-01-04 15:04:06 -08:00
Mike Danese
9edd019f97 vendor: removed unused dep github.com/elazarl/goproxy
Kubernetes-commit: f61c4245c18724dcac88f0ad9f347e82bbb57cd7
2022-11-04 22:14:46 +00:00
Kubernetes Publisher
e6998df99e Merge pull request #115093 from xuzhenglun/too-large-resource-version-1.16
Fix bug in reflector not detecting "Too large resource version" error before 1.17.0

Kubernetes-commit: d3f881f7508ec3bd8aa83712038bdcf5f4703396
2023-01-18 11:59:00 +00:00
Kubernetes Publisher
a13376f3fa Merge pull request #114542 from pacoxu/EphemeralContainers
cleanup: EphemeralContainers feature gate related codes

Kubernetes-commit: c913e6ce62d23b19eebec9beda91d7599bf5099b
2023-01-17 20:14:45 +00:00
xuzhenglun
7685b51912 Fix bug in reflector not detecting "Too large resource version" error before 1.17.0
Kubernetes-commit: 11e5e92dc65c1caaeb248a60d90ccc8e29eb9ff0
2023-01-16 11:36:28 +08:00
Kubernetes Publisher
228b004f4a Merge pull request #115077 from smarterclayton/reflector_mock_clock
cache: Reflector should have the same injected clock as its informer

Kubernetes-commit: 4c4d4ad0a4aea4d015561ae3e7d48e8aaf609277
2023-01-15 17:24:49 -08:00
Clayton Coleman
08e22c4b64 cache: Reflector should have the same injected clock as its informer
While refactoring the backoff manager to simplify and unify the code
in wait a race condition was encountered in
TestSharedInformerWatchDisruption. The new implementation failed
because the fake clock was not propagated to the backoff managers
when the reflector was used in a controller. After ensuring the
mangaers, reflector, controller, and informer shared the same
clock the test needed was updated to avoid the race condition by
advancing the fake clock and adding real sleeps to wait for
asynchronous propagation of the various goroutines in the controller.

Due to the deep structure of informers it is difficult to inject
hooks to avoid having to perform sleeps. At a minimum the FakeClock
interface should allow a caller to determine the number of waiting
timers (to avoid the first sleep).

Kubernetes-commit: 91b3a81fbd916713afe215f7d701950e13a02869
2023-01-14 14:17:33 -05:00