Commit Graph

252 Commits

Author SHA1 Message Date
Matthieu MOREL
acc5917341 fix: enable empty and len rules from testifylint on pkg package
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

Co-authored-by: Patrick Ohly <patrick.ohly@intel.com>

Kubernetes-commit: f014b754fb5925dfbca6e27a44d0c3968b157e14
2024-06-28 21:20:13 +02:00
Lukasz Szaszkiewicz
9a760efea1 client-go/util/watchlist: intro CanUseWatchListForListRequest
Kubernetes-commit: 38fae9b799393f6fe17d07fb8148f05b1110859b
2024-06-10 18:03:47 +02:00
Lukasz Szaszkiewicz
14559c0fec client-go/consistencydetector: introduce CheckWatchListFromCacheDataConsistencyIfRequested
Kubernetes-commit: f7f3809c513cd051c2c45bbef0655cf5a3eceea2
2024-06-10 22:52:47 +02: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
Lukasz Szaszkiewicz
20d0a8ee82 client-go/consistencydetector: extend TestDataConsistencyChecker to test unstructured data
Kubernetes-commit: c8971c456f23627a91dc79bb8bc840a32dea611f
2024-06-07 10:33:11 +02: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
Lukasz Szaszkiewicz
c7d706847a client-go/consistencydetector: handles the watch cache legacy case
Kubernetes-commit: fe8a2d222cc4208ee8f89fd2912d35cf58ec5941
2024-06-04 18:37:37 +02:00
Stephen Kitt
16552d4656 Use canonical json-patch v4 import
The canonical import for json-patch v4 is
gopkg.in/evanphx/json-patch.v4 (see
https://github.com/evanphx/json-patch/blob/master/README.md#get-it for
reference).

Using the v4-specific path should also reduce the risk of unwanted v5
upgrade attempts, because they won't be offered as automated upgrades
by dependency upgrade management tools, and they won't happen through
indirect dependencies (see
https://github.com/kubernetes/kubernetes/pull/120327 for context).

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

Kubernetes-commit: 5300466a5c8988b479a151ceb77f49dd00065c83
2024-02-16 13:57:24 +01:00
Lukasz Szaszkiewicz
b7ea49a199 client-go/util/consistencydetector: add CheckListFromCacheDataConsistencyIfRequested
Kubernetes-commit: 48014bd7bdc331efea509a752694393ac929f270
2024-05-27 15:11:50 +02: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
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
Alvaro Aleman
d67dddfe90 Workqueue: Add generic versions that are properly typed
This change adds a generic version of the various workqueue types while
retaining compatibility for the existing exported symbols and constructors.
The generic variants are prefixed with `Typed` and the existing ones are
marked as deprecated to nudge people to transition without breaking
them.

Kubernetes-commit: 0c7370bb851c15825d30a516722139ccccca0cfc
2024-04-11 18:11:41 -04:00
Lan Liang
fa185a21db cleanup: delete rand.Seed(time.Now().UnixNano()) and using global number generator.
see https://tip.golang.org/doc/go1.20

Signed-off-by: Lan Liang <gcslyp@gmail.com>

Kubernetes-commit: dc992adad385ab631e4a528ee6a342ea71e7a379
2024-03-18 08:10:12 +00:00
Haibing Zhou
9c3db8681d workqueue: make queue as configurable
The default queue implementation is mostly FIFO and it is not
exchangeable unless we implement the whole `workqueue.Interface` which
is less desirable as we have to duplicate a lot of code. There was one
attempt done in [kubernetes/kubernetes#109349][1] which tried to
implement a priority queue. That is really useful and [knative/pkg][2]
implemented something called two-lane-queue. While two lane queue is
great, but isn't perfect since a full slow queue can still slow down
items in fast queue.

This change proposes a swappable queue implementation while not adding
extra maintenance effort in kubernetes community. We are happy to
maintain our own queue implementation (similar to two-lane-queue) in
downstream.

[1]: https://github.com/kubernetes/kubernetes/pull/109349
[2]: https://github.com/knative/pkg/blob/main/controller/two_lane_queue.go

Kubernetes-commit: 87b4279e07349b3c68f16f69a349a02bddd12f25
2024-02-16 12:09:37 -08:00
Erik Godding Boye
0b7086f721 feat: add csaupgrade option to upgrade subresource
Kubernetes-commit: 9633e25579dfa5449450875b9a238acc7cfac3e8
2024-02-24 15:44:21 +01:00
weilaaa
c609c97b33 use build-in max and min func to instead of k8s.io/utils/integer funcs
Kubernetes-commit: eb8f3f194fed16484162aebdaab69168e02f8cb4
2023-12-15 15:09:11 +08:00
Antonio Ojea
374e3638f2 workqueue unit tests to assert collapsing behaviors
Change-Id: If4bf54c3af603c17de49055960f9a76e7d38aab3

Kubernetes-commit: 8a31bb6786c2d3600bade49de7a64a026802bd6d
2023-09-21 10:48:01 +00:00
acejilam
a8fc969a34 Fix: null jsonpath serialization
Signed-off-by: acejilam <acejilam@gmail.com>

Kubernetes-commit: 9646ae5a9efb0eee7ac15577d113699700233017
2023-08-10 19:32:47 +08:00
Dave McCormick
e9b0103a41 Fix a race where a call to Shutdown was happening after ShutDownWithDrain() had performed the check q.isProcessing() && q.shouldDrain() and before waitForProcessing() has reached its Wait(). This is because waitForProcessing() is only checking the length part of the condition instead of both the length and whether we still need to drain.
It turned out that there were lots of unnecessary accessor functions being called locking and unlocking the cond which are not needed because Wait() automatically unlocks and locks the cond for us and best practice says we should run it in a for checking for the condition (so this is what I have done).

Kubernetes-commit: 2b12df56b0be93bc2cac7c5a66342c0ffaa72311
2023-07-24 22:40:54 +01:00
Etienne Champetier
089cdcdf71 client-go: allow to set NotBefore in NewSelfSignedCACert()
Signed-off-by: Etienne Champetier <e.champetier@ateme.com>

Kubernetes-commit: 44692a486f96bda80ffd2a2a132a651b47457391
2023-06-28 00:01:34 -04:00
Etienne Champetier
d19c2b99a8 Revert "Make CA valid 1 hour in the past"
Kubernetes-commit: 56c5c8f7eef25748389987a416d272bf8db2431d
2023-06-27 08:57:59 -04:00
Etienne Champetier
d606148375 Make CA valid 1 hour in the past
When running kubeadm / installing k8s early during boot,
the CA certificate can be generated before time is synchronised
and time is jumped backward.
Make notBefore 1 hour in the past to accept small clock jump.

Signed-off-by: Etienne Champetier <e.champetier@ateme.com>

Kubernetes-commit: e1735b9863777ff11ac35434e047c38dcce4b4f3
2023-06-13 01:04:28 -04:00
HirazawaUi
a9b2f9e9eb add remove_file in client-go util directory
Kubernetes-commit: f49cc5eb113b839a5f5c6121ff0b89f82a483011
2023-05-03 01:33:28 +08:00
Min Ni
a3b4cd32e5 update serial number to a valid non-zero number in ca certificate (#117791)
* update serial number to a valid non-zero number in ca certificate

* fix the existing problem (0 SerialNumber in all certificate) as part of this PR in a separate commit

Kubernetes-commit: e865b30abd0a862697ff1d2526ea8897ee98a523
2023-05-09 17:07:46 +00:00
austin ce
21b4553e44 Allow custom metric provider for retry metrics
Kubernetes-commit: a60624ffbc265d61b35cab16ea9ded485909f3ed
2023-03-10 17:48:10 -05:00
austin ce
66fa9d308f Unify queue constructors, deprecate current constructors
Kubernetes-commit: fea83b78243c77e81b91f3f0a812979809aeacaf
2023-03-10 17:46:26 -05:00
austin ce
9668243c04 Integrate new metrics provider option in test case
Kubernetes-commit: 9e83e7e975dd5971e60e9768e06520aa5ebf9bf8
2022-12-02 14:08:11 -05:00
austin ce
e0785d6713 Remove options from queue ctors w/o metrics
Kubernetes-commit: 31f16db1959bb1db02fcc578f4aa7d47414a26f4
2022-12-02 14:06:37 -05:00
austin ce
89a4c1271f Add license header to new file
Kubernetes-commit: 95ad089ff8164d455f766694b1292ca8f1d200df
2022-12-01 18:28:02 -05:00
austin ce
98d0d1a9ba Allow setting per-queue metrics providers
Kubernetes-commit: da71811514ac6e8fedd265831fed71f897b97781
2022-11-29 20:47:33 -05:00
Antoine Pelisse
e2867f9cdc Update kubernetes code for minor API changes to kube-openapi
Kubernetes-commit: 88ec8fba32f0ef7b768ec528cfbe44046877ea34
2022-12-29 12:12:33 -08:00
Khachatur Ashotyan
bd24c4230e client-go: change permissions of key
Kubernetes-commit: 49af62e64f33317ec0c12f9ed8ab8a0d4f365d44
2023-02-17 14:21:24 +04:00
Khachatur Ashotyan
a7dbbf8255 client-go: change permissions of GenerateSelfSignedCertKeyWithFixtures generated cert
Kubernetes-commit: 3cc99c5e77185ce26fd2d5513336e7229c5f7441
2023-02-17 11:20:39 +04:00
Khachatur Ashotyan
be82893604 client-go: change permissions of directories and certs
Kubernetes-commit: c941877438c2219318b0625f5b4e321efe324171
2023-02-17 11:16:46 +04:00
Khachatur Ashotyan
71253f0b35 fix: comment about permission bits
Kubernetes-commit: fd17dcf3876458229ac15d426eb1bd58f8c52cb4
2023-02-03 13:40:33 +04:00
Khachatur Ashotyan
03568a1821 client-go: make generating certificate/key permissions more secure (600)
Kubernetes-commit: 5f81c3005f6d3aeb652a0626c3632ff68b036577
2023-02-02 14:52:45 +04:00
Paco Xu
6a07cedcd3 kubelet: add key encipherment usage only if it is rsa key
remove allowOmittingUsageKeyEncipherment as it is always true

Signed-off-by: Paco Xu <paco.xu@daocloud.io>

Kubernetes-commit: 160f015ef4affe903f98e74cf42b40fceef15cb9
2022-08-03 16:41:09 +08:00
Jordan Liggitt
422fe1f61e Fix indentation/spacing in comments to render correctly in godoc
Kubernetes-commit: 78cb3862f11225135afdf76f3424e2d7b33104c7
2022-12-17 17:31:05 -05:00
Alexander Zielenski
898b7a3cbd add FindFieldsOwners util function
to be used by kubectl to determine csa manager name used

findowners

Kubernetes-commit: 26a6e1234869b5c546195aaf416f3424cd3c3dc8
2022-11-03 12:01:34 -07:00
Alexander Zielenski
4f63b629b5 add UpgradeManagedFieldsPatch
rather than modify the object directly, this function provides a JSONPATCH that should be sent to the server to upgrade its managed fields.

Kubernetes-commit: 4e4d748c06e2c2dfec7608f96237c4b0a42540c9
2022-11-03 17:38:08 -07:00
Alexander Zielenski
c8c6cb5745 add OWNERS to csaupgrade
Kubernetes-commit: 5002ba215bcaec75a65ccd1ee879c64538b970b7
2022-11-03 17:38:02 -07:00
Alexander Zielenski
a45874a99b remove kubectl annotation logic from upgrade patch
adds unneccessary complexity. also discussed in SIG CLI meeting to keep annotation around for a while longer

Kubernetes-commit: 0c055eae3c9eaea26574743f0623d6b0e9e3d6b4
2022-11-03 12:05:45 -07:00
Alexander Zielenski
12cafe2b1b refactor to use Schema(contentType)
Kubernetes-commit: e6e6dd826d76a2b19515cd907062f1f74f9e52c2
2022-10-14 12:46:36 -07:00
Alexander Zielenski
00d892f447 correct spacing
Kubernetes-commit: dbff8e117c8d4aeccac6ea211dfa334e30621727
2022-09-06 20:58:50 -07:00
Alexander Zielenski
2efbeaf56e add boilerplate
Kubernetes-commit: 3528fd7e47f585c144b13c0c2b75bc4e432987c6
2022-09-06 19:51:47 -07:00