Commit Graph

4455 Commits

Author SHA1 Message Date
Kubernetes Publisher
8fc5a64651 Merge pull request #125383 from p0lyn0mial/upstream-unstructured-testchecklistconsistency
client-go/consistencydetector: refactor TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath to work with unstructured data

Kubernetes-commit: 51f89c3b2d114fea99d3a0e8401c639f39e27877
2024-06-07 07:50:55 -07:00
Lukasz Szaszkiewicz
503a0905c0 client-go/util/consistencydetector: extend TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath to work with unstructured list
Kubernetes-commit: a2a48a475b4c98daeea3f83b8a89aa070ea4082b
2024-06-07 10:55:01 +02:00
Lukasz Szaszkiewicz
2d885a2ed5 client-go/util/consistencydetector: refactor TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath to work with unstructured data
Kubernetes-commit: c5904424b2b03cec1befaf16c55bb97df57669bc
2024-06-07 10:43:28 +02:00
Kubernetes Publisher
e8224736d3 Merge pull request #125379 from p0lyn0mial/upstream-unstructured-testdataconsistencychecker
client-go/consistencydetector: refactor TestDataConsistencyChecker to work with unstructured data

Kubernetes-commit: 96815d6dc8de717579484ffef88f74063dfd40ca
2024-06-07 16:41:08 +00:00
Kubernetes Publisher
94cabc85d9 Merge pull request #125302 from karlkfi/karl-informer-watcher-test
Update TestNewInformerWatcher for WatchListClient

Kubernetes-commit: 169a952720ebd75fcbcb4f3f5cc64e82fdd3ec45
2024-06-07 12:40:56 +00:00
Kubernetes Publisher
1fc4f8ad34 Merge pull request #124963 from p0lyn0mial/upstream-data-consistency-checker-for-list-requests
client-go: data consistency checker for list requests

Kubernetes-commit: 3532601ad8c7249be13cd8187f8124fc68da4c4b
2024-06-07 08:40:44 +00:00
Lukasz Szaszkiewicz
20d0a8ee82 client-go/consistencydetector: extend TestDataConsistencyChecker to test unstructured data
Kubernetes-commit: c8971c456f23627a91dc79bb8bc840a32dea611f
2024-06-07 10:33:11 +02:00
Kubernetes Publisher
1c075dc88c Merge pull request #124642 from wojtek-t/resilient_watchcache_initialization
Implement ResilientWatchCacheInitialization

Kubernetes-commit: eef6c6082d4e34fc4a0675a36ec5cc575cd13696
2024-06-07 04:40:45 +00:00
Kubernetes Publisher
098e7c5a9b Merge pull request #125356 from p0lyn0mial/upstream-improve-testdrivechecklistfromcache-test
improve TestDriveCheckListFromCacheDataConsistencyIfRequested

Kubernetes-commit: 4e2a6201a43f4c8bbb633ae8edc8cc47b1a39ee7
2024-06-06 16:44:40 +00:00
Lukasz Szaszkiewicz
82627741cb client-go/consistencydetector: refactor TestDataConsistencyChecker to work with unstructured data
Kubernetes-commit: d535f55ef9dd391712db09ac69dd083089457366
2024-06-06 14:14:33 +02:00
Lukasz Szaszkiewicz
bbe85a4a80 fix TestDriveCheckListFromCacheDataConsistencyIfRequested
Kubernetes-commit: 82794c4963144bf5298089030733f993a44f7c3b
2024-06-05 22:41:09 +02:00
Kubernetes Publisher
b03e5b8438 Merge pull request #125335 from p0lyn0mial/upstream-consistency-decector-handles-legacy-case
client-go/consistencydetector: handles the watch cache legacy case

Kubernetes-commit: dae37c21645c0fc04bbb0202ad1eba6ba4438d23
2024-06-05 05:37:20 -07:00
Lukasz Szaszkiewicz
c7d706847a client-go/consistencydetector: handles the watch cache legacy case
Kubernetes-commit: fe8a2d222cc4208ee8f89fd2912d35cf58ec5941
2024-06-04 18:37:37 +02:00
Lukasz Szaszkiewicz
5d84e91dbf client-go/dynamic: use CheckListFromCacheDataConsistencyIfRequested
Kubernetes-commit: 79370c6d676814758c60bbc1b71a882583be2214
2024-06-04 10:23:19 +02:00
Kubernetes Publisher
7c6e307a72 Merge pull request #125299 from karlkfi/karl-reflector-fix-2
Improve Reflector unit tests

Kubernetes-commit: 5bf1e95541d90e37f6c6637b5b45d8783e7907aa
2024-06-04 00:39:33 +00:00
Karl Isenberg
7c5e9038dd Update TestNewInformerWatcher for WatchListClient
- Switch to using the ProxyWatcher to validate the dance between
  closing the stop channel and closing the result channel.
- Use the new clientfeaturestesting.SetFeatureDuringTest to test with
  the WatchListClient enabled and disabled. These should result in
  almost the exact same output events from the informer
  (list ordering not garenteed), but with different input events
  recieved from the apiserver.

Kubernetes-commit: 28e3a728e5e6fe651d7a17839d33ce42204c0b4e
2024-06-03 17:31:59 -07:00
Karl Isenberg
8c9cb8838f Improve Reflector unit tests
- Add tests to confirm that Stop is always called.
- Add TODOs to show were Stop is not currently being called
  (to fix in a future PR)

Kubernetes-commit: ab5aa4762fd5206d0dbd8412d7c6f3b76533a122
2024-06-03 12:15:38 -07:00
Kubernetes Publisher
52e5651101 Merge pull request #122832 from benluddy/cbor-fuzz-native-to-unstructured-via
KEP-4222: Add roundtrip tests to Unstructured via CBOR and JSON.

Kubernetes-commit: f30a87d517c538f22e1d84b4d7c497f57f7b760a
2024-05-31 00:39:27 +00:00
Kubernetes Publisher
d81b8f6492 Merge pull request #123974 from p0lyn0mial/upstream-client-go-features-testing
client-go/features/testing: intro SetFeatureGatesDuringTest

Kubernetes-commit: 9a44f689167849e1251f801199e9517ee00fe6bd
2024-05-30 00:39:20 +00:00
Shingo Omura
7adab2f2f6 KEP-3619: Fine-grained SupplementalGroups control (#117842)
* Add `Linux{Sandbox,Container}SecurityContext.SupplementalGroupsPolicy` and `ContainerStatus.user` in cri-api

* Add `PodSecurityContext.SupplementalGroupsPolicy`, `ContainerStatus.User` and its featuregate

* Implement DropDisabledPodFields for PodSecurityContext.SupplementalGroupsPolicy and ContainerStatus.User fields

* Implement kubelet so to wire between SecurityContext.SupplementalGroupsPolicy/ContainerStatus.User and cri-api in kubelet

* Clarify `SupplementalGroupsPolicy` is an OS depdendent field.

* Make `ContainerStatus.User` is initially attached user identity to the first process in the ContainerStatus

It is because, the process identity can be dynamic if the initially attached identity
has enough privilege calling setuid/setgid/setgroups syscalls in Linux.

* Rewording suggestion applied

* Add TODO comment for updating SupplementalGroupsPolicy default value in v1.34

* Added validations for SupplementalGroupsPolicy and ContainerUser

* No need featuregate check in validation when adding new field with no default value

* fix typo: identitiy -> identity

Kubernetes-commit: 552fd7e85084b4cbd3ae8e81ff13433e28dc8327
2024-05-30 00:39:19 +00:00
Kubernetes Publisher
e8b54718d0 Merge pull request #123339 from skitt/canonical-json-patch
Update kustomize, use canonical json-patch v4 import

Kubernetes-commit: da02fdb2aef1b7102526963c91df4992ee5b6a05
2024-05-29 20:39:23 +00:00
Kubernetes Publisher
9c87eb0815 Merge pull request #125190 from pohly/record-event-panic
client-go record: avoid panic when watch creation failed

Kubernetes-commit: ea0ab06b6915945c20a86d1de588e4ac7a5b6d58
2024-05-29 06:20:33 -07:00
Patrick Ohly
b4e1cfcfab client-go record: avoid panic when watch creation failed
The previous attempt to fix this in
6aa779f4ed (diff-efa2cd1347df22ace5a516ea794152d00ef2a079db135c81787ed920ecb73658)
didn't address the root cause (or perhaps created it, not sure): the goroutine
must not be started if watch creation failed.

Instead, the error gets logged (as before) and an empty watch gets returned to
the caller (new). This is necessary because the function doesn't have an error
return value and changing that now would be disruptive. The empty watch is
valid and usable, so callers won't crash when they calls Stop.

This showed up recently in failed unit tests, probably because test
cancellation makes this error more likely:

   "Unable start event watcher (will not retry!)" err="broadcaster already
   stopped" logger="TestGarbageCollectorConstruction leaked goroutine"

The logger value and a preceding warning show that this occurs after test
completion.

Kubernetes-commit: 080432c46a7a49c3abf86d7fc5f2a5d7abc92239
2024-05-29 14:10:49 +02:00
Kubernetes Publisher
5d650114a5 Merge pull request #125159 from p0lyn0mial/upstream-add-data-consistency-checker-for-list-requests
client-go/util/consistencydetector: add CheckListFromCacheDataConsistencyIfRequested

Kubernetes-commit: 1d5589e4910ed859a69b3e57c25cbbd3439cd65f
2024-05-29 12:39:08 +00:00
Kubernetes Publisher
3f130bd830 Merge pull request #125166 from p0lyn0mial/upstream-improve-check-data-consistency
client-go/util/consistencydetector: improve validation of list parameters (RV, ListOptions)

Kubernetes-commit: bc8ec4f9aaaeee7de285c0207bd8eb793ecf3307
2024-05-29 00:38:51 +00:00
Kubernetes Publisher
5f741a5d35 Merge pull request #125052 from p0lyn0mial/upstream-client-go-env-var-set
client-go/features: add Set method to the envvar impl

Kubernetes-commit: 8991e825d5f2affce16a05666c11d7a2a773a628
2024-05-28 16:39:07 +00:00
Kubernetes Publisher
b92b563c44 Merge pull request #124635 from pohly/event-broadcaster-shutdown-fix
client-go/tools/record: fix and test Broadcaster shutdown + logging

Kubernetes-commit: f4ea903712482c4a0021cc9c8d742673a213833e
2024-05-28 16:39:05 +00:00
Lukasz Szaszkiewicz
785fca481f client-go/util/consistencydetector: improve validation of list parameters (RV, ListOptions)
Kubernetes-commit: 327ae9866bda463ae43bd133a2522d5beea5ed35
2024-05-28 12:22:59 +02:00
Kubernetes Publisher
f53839a9ad Merge pull request #125045 from pohly/ginkgo-gomega-update
dependencies: ginkgo v2.19.0, gomega v1.33.1

Kubernetes-commit: 1c84623028b496e22d8401100ef6f59325e092e0
2024-05-28 08:39:08 +00:00
Lukasz Szaszkiewicz
9f33e96b6a make update
Kubernetes-commit: 448180db60fc1d62174a18d1dd995d8deb081428
2024-05-27 15:31:15 +02:00
Kubernetes Publisher
c559583d36 Merge pull request #125146 from p0lyn0mial/upstream-client-go-consistency-detector-move-to-new-package
client-go: move data consistency detector to a new package

Kubernetes-commit: 9d5db28f5f5d5a35012dd6162af374420e6e1f4c
2024-05-27 06:24:08 -07:00
Lukasz Szaszkiewicz
b7ea49a199 client-go/util/consistencydetector: add CheckListFromCacheDataConsistencyIfRequested
Kubernetes-commit: 48014bd7bdc331efea509a752694393ac929f270
2024-05-27 15:11:50 +02:00
Lukasz Szaszkiewicz
538b7809aa move checkWatchListDataConsistencyIfRequested back to client-go/tools/cache
Kubernetes-commit: cb44f83b3d500bb2ed29f7634095bc64c9b21729
2024-05-27 11:22:28 +02:00
Lukasz Szaszkiewicz
e6e45e172b client-go/util/consistencydetector: make the detector public
Kubernetes-commit: e421046f64c90b58577a79f92dd463ab03479d79
2024-05-27 11:16:17 +02:00
Lukasz Szaszkiewicz
92f0985ce1 client-go/util/consistencydetector: update after moving to the new package
Kubernetes-commit: faf5110c8a2394f9d098da6e5097ce6deed1b18b
2024-05-27 11:13:18 +02:00
Lukasz Szaszkiewicz
e428fc295c move client-go/tools/cache/reflector_data_consistency_detector to client-go/util/consistencydetector
Kubernetes-commit: 272dfc9d7e61481dfcdc4d6a021385d9cd85ba5f
2024-05-27 11:10:43 +02:00
Kubernetes Publisher
fd6b8e6551 Merge pull request #125144 from p0lyn0mial/upstream-client-go-consistency-detector-refactor-units
client-go/tools/cache/reflector_data_consistency_detector: refactor unit tests

Kubernetes-commit: 58fe98e2cc7f8efac886765af230a48285d7b9b6
2024-05-27 03:26:50 -07:00
Lukasz Szaszkiewicz
00036b79c4 client-go/tools/cache/reflector_data_consistency_detector: refactor unit tests
Kubernetes-commit: 18837d60ae12ac70380ce5cf21cfd8e0d221263a
2024-05-27 11:10:00 +02:00
Kubernetes Publisher
0123e78ef6 Merge pull request #124446 from p0lyn0mial/watch-list-consistency-detector-more-generic
client-go/consistency-detector: change the signature of checkWatchListConsistencyIfRequested

Kubernetes-commit: f5d62f738a686ddc6221a85374113af80790129e
2024-05-27 08:39:07 +00:00
Lukasz Szaszkiewicz
e89e40c187 client-go/rest: add TestWatchListWhenFeatureGateDisabled unit test
Kubernetes-commit: 8c0c1f720182f138c3151d3d67a80fa67b86a240
2024-05-23 16:33:43 +02:00
Lukasz Szaszkiewicz
e8eae94e45 client-go/features/testing: intro SetFeatureGatesDuringTest
Kubernetes-commit: 3d97808b95b355bb8e56d4d720342e9a7ab95ced
2024-05-23 14:44:11 +02:00
Lukasz Szaszkiewicz
98df4f79ac client-go/features: add Set method to envvar impl
Kubernetes-commit: a07654baa54d53d7649e981c0c65eb8d1210e4af
2024-05-22 15:42:47 +02:00
Patrick Ohly
2f2b800097 dependencies: ginkgo v2.19.0, gomega v1.33.1
Ginkgo v2.18.0 allows tweaking the output so that
it's easier to follow while a job runs in
Prow (https://github.com/onsi/ginkgo/issues/1347). Using this in
hack/ginkgo-e2e.sh will follow in a separate commit.

Gomega gets bumped to the latest release to keep it up-to-date.

Ginkgo v1.19.0 adds support for --label-filter with labels that represent
sets (like our Feature:<Foo>).

Kubernetes-commit: 37e2dd6857084a172ef5210caee1fefa8dd8159a
2024-05-22 10:22:09 +02:00
Ben Luddy
3aa51ce508 Update indirect dependencies with ./hack/update-vendor.sh.
Implementing custom marshaling on several API types for CBOR makes the upstream CBOR library an
indirect dependency of several staging modules.

Kubernetes-commit: d7cccf3e792ad08d9ab2e7aac394f8e6ddcf3466
2024-05-17 13:02:26 -04:00
Patrick Ohly
ebbf7d7dc3 client-go/tools/record: fix and test Broadcaster shutdown + logging
Constructing a Broadcaster already starts a watch which runs in the
background. Shutdown must be called to avoid leaking the goroutine.  Providing
a context was supposed to remove the need to call Shutdown, but that did not
actually work because the logic for "must check for cancellation" was
accidentally inverted.

While at it, structured log output also gets tested together with checking for
goroutine leaks.

Kubernetes-commit: ff779f1cb56cf896405e52f7923188b99b88bb00
2024-04-30 12:16:55 +02:00
Wojciech Tyczyński
b444e6c32e Implement ResilientWatchCacheInitialization
Kubernetes-commit: a8ef6e9f0104a44023162bb8229fb677ec80beb1
2024-04-29 14:19:46 +02:00
Lukasz Szaszkiewicz
6bdde7723e client-go/consistency-detector: change the signature of checkWatchListConsistencyIfRequested
the signature of the method was tightly connected to the reflector,
making it difficult to use for anything other than a reflector.

this simple refactor makes the method more generic.

Kubernetes-commit: 83c7542abc8c542c01ecb67376f134b2071c5304
2024-04-22 14:01:22 +02:00
Kubernetes Publisher
c7396197f3 Merge pull request #122791 from p0lyn0mial/upstream-cleanup-watch-list-env-var
cleanup: replace ENABLE_CLIENT_GO_WATCH_LIST_ALPHA with WatchListClient gate

Kubernetes-commit: 8c1983ffc0b6fe2293fc721cef8d961d79aafc53
2024-05-21 02:05:35 -07:00
Lukasz Szaszkiewicz
4a34196022 replace ENABLE_CLIENT_GO_WATCH_LIST_ALPHA with WatchListClient gate
Kubernetes-commit: 9248cccc27fdd52a9a99fd9ad6e47ada9ee8b568
2024-04-30 08:24:53 +02:00
Kubernetes Publisher
86f83bc818 Merge pull request #124614 from p0lyn0mial/upstream-reflector-warn-no-bookmark-event
client-go/reflector: warns when the bookmark event for initial events hasn't been received

Kubernetes-commit: b10a141fd2c291feea78c4e36483933b25368224
2024-05-20 16:38:45 +00:00