Commit Graph

310 Commits

Author SHA1 Message Date
Patrick Ohly
8a908e0c0b remove import doc comments
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:

- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.

This commit was generated with
   sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')

Everything was included, except for
   package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".
2024-12-02 16:59:34 +01:00
Davanum Srinivas
2b0592ee77 Use k8s.io/utils/lru instead of github.com/golang/groupcache/lru
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-11-04 10:51:13 -05:00
Kubernetes Prow Robot
6edbee19b9 Merge pull request #123152 from tnqn/fix-error-log
Fix internal error when serializing groupLookupFailures in log
2024-10-23 01:17:29 +01:00
haorenfsa
da5f6cf053 garbagecollector: fix logs & comments in gc sync
Signed-off-by: haorenfsa <haorenfsa@gmail.com>
2024-09-14 00:01:38 +08:00
haorenfsa
87ca404634 garbagecollector: add initialSyncTimeout for Run
Signed-off-by: haorenfsa <haorenfsa@gmail.com>
2024-09-14 00:01:37 +08:00
haorenfsa
d4fdfaf17d test/integration/garbagecollector: add test TestCascadingDeleteOnCRDConversionFailure which tests that GC controller cannot be blocked by a bad conversion webhook
Signed-off-by: haorenfsa <haorenfsa@gmail.com>
Co-authored-by: Andrew Sy Kim <andrewsy@google.com>
2024-09-13 23:14:41 +08:00
Andrew Sy Kim
e8b1d7dc24 garbagecollector: controller loop should not be blocking on failed cache sync
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
Co-authored-by: He Xiaoxi <xxhe@alauda.io>
2024-09-13 23:14:23 +08:00
Joe Betz
2595aa1309 generate 2024-09-03 14:26:26 -04:00
Dr. Stefan Schimanski
c7a1fa432a Call non-blocking informerFactory.Start synchronously to avoid races
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
2024-07-27 18:13:09 +02:00
Matthieu MOREL
f014b754fb 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>
2024-07-06 23:15:43 +00:00
Kubernetes Prow Robot
0d17892740 Merge pull request #123184 from googs1025/delete_repeat_comments
typo: delete useless comments
2024-06-24 16:48:32 -07:00
Alvaro Aleman
6d0ac8c561 Use the generic/typed workqueue throughout
This change makes us use the generic workqueue throughout the project in
order to improve type safety and readability of the code.
2024-05-04 14:33:12 -04:00
googs1025
a29dc0bc90 typo: delete useless comments 2024-03-30 17:14:39 +08:00
Nilekh Chaudhari
9161302e7f feat: implements svm controller
Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>
2024-03-08 19:25:10 +00:00
Mengjiao Liu
b584b87a94 kube-controller-manager: readjust log verbosity
- Increase the global level for broadcaster's logging to 3 so that users can ignore event messages by lowering the logging level. It reduces information noise.
- Making sure the context is properly injected into the broadcaster, this will allow the -v flag value to be used also in that broadcaster, rather than the above global value.
- test: use cancellation from ktesting
- golangci-hints: checked error return value
2024-02-26 14:51:56 +08:00
Quan Tian
3160386f29 Fix internal error when serializing groupLookupFailures in log
When garbagecollector failed to look up ServerPreferredResources, it
logged the failed groups as "<internal error: json: unsupported type:
map[schema.GroupVersion]error>", making the failure more obscure.

It's because the logger tried to serialize the value using json encoder
but the type map[schema.GroupVersion]error is not supported. Either
schema.GroupVersion needs to implement TextMarshaler interface, or we
can serialize the type before passing it to the logger.

Signed-off-by: Quan Tian <qtian@vmware.com>
2024-02-06 18:55:05 +08:00
Jordan Liggitt
c9a084d59c Fix duplicate GC event handlers getting added if discovery flutters 2023-07-12 12:29:31 -04:00
Ziqi Zhao
dfc1838379 Migrated pkg/controller/volume|util|replicaset|nodeipam to contextual logging
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
2023-07-06 07:39:52 +08:00
xin.li
3cf2822bc5 Migrated pkg/controller/garbagecollector to contextual logging
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-07-06 07:36:51 +08:00
Joe Betz
f0f92853ad Add api-machinery TL owners permissions for jpbetz 2023-05-15 11:09:54 -04:00
Daniel Smith
1ffe3f467e lavalamp is taking a long break 2023-05-11 16:43:38 +00:00
Hao Ruan
c4e1b01416 replace spew methods with dump methods 2023-04-14 08:05:53 +08:00
Patrick Ohly
99151c39b7 kube-controller-manager: convert to structured logging
Most of the individual controllers were already converted earlier. Some log
calls were missed or added and then not updated during a rebase. Some of those
get updated here to fill those gaps.

Adding of the name to the logger used by each controller gets
consolidated in this commit. By using the name under which the
controller is registered we ensure that the names in the log
are consistent.
2023-03-14 19:16:32 +01:00
Patrick Ohly
cbf7d96a85 garbagecollector: structured logging of objectReference
When using JSON as output format, we want objectReference values to be
represented as a struct. For example, "item" is such a value:

{"ts":1678135015708.349,"caller":"garbagecollector/garbagecollector.go:595","msg":"classify object references","v":5,"item":{"name":"dra-test-driver-g4tkd","namespace":"dra-1830","apiVersion":"v1","uid":"c3f88616-7282-488c-887c-3f04291e6f4f"},"solid":null,"dangling":[{"apiVersion":"apps/v1","kind":"ReplicaSet","name":"dra-test-driver","uid":"dbe9a90c-9dfd-4ad0-8395-e5fa228f9851","controller":true,"blockOwnerDeletion":true}],"waitingForDependentsDeletion":null}
2023-03-08 08:37:56 -05:00
Andy Goldstein
26e3dab78b garbagecollector: use contextual logging
Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
2023-03-08 08:37:56 -05:00
ialidzhikov
aede3fbf40 pkg/controller: Replace deprecated func usage from the k8s.io/utils/pointer pkg 2022-11-23 17:40:23 +02:00
Jordan Liggitt
8221960b65 Reimplement GC dot graph dumping without gonum library 2022-09-23 13:12:33 -04:00
Kubernetes Prow Robot
42b6b2887c Merge pull request #110888 from likakuli/feature_ignoreeventforgc
feat: ignore all event resource for gc
2022-08-01 12:10:28 -07:00
Abirdcfly
00b9ead02c cleanup: remove duplicate import
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2022-07-14 11:25:19 +08:00
likakuli
74a3b8f4a9 feat: fix a bug thaat not all event be ignored by gc controller
Signed-off-by: likakuli <1154584512@qq.com>
2022-07-04 18:00:54 +08:00
Wojciech Tyczyński
32cbd77121 Clean shutdown of garbagecollector integration tests 2022-06-13 00:14:19 +02:00
Kubernetes Prow Robot
0b79a791ed Merge pull request #107180 from ardaguclu/remove-deprecated-serverresource
Remove deprecated discovery/ServerResources function
2022-03-25 23:45:21 -07:00
atiratree
2fc401d0a2 add gc metrics and collect sync errors 2022-02-04 20:21:30 +01:00
jlsong01
d66b3edd65 allocate a unique scheme for each test to fix concurrent usage issue 2022-02-02 15:22:59 +08:00
Kubernetes Prow Robot
3bd422dc76 Merge pull request #107293 from dims/jan-1-owners-cleanup
Cleanup OWNERS files - Jan 2021 Week 1
2022-01-13 10:30:30 -08:00
Davanum Srinivas
9682b7248f OWNERS cleanup - Jan 2021 Week 1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-01-10 08:14:29 -05:00
astraw99
a5a54754d5 refactor garbagecollection controllers to make forget impossible to forget 2022-01-09 15:19:10 +08:00
Arda Güçlü
ef39a89142 Remove deprecated discovery/ServerResources function
ServerResources function was deprecated and instead ServerGroupsAndResources
function is suggested.

This PR removes ServerResources function and move every place to use ServerGroupsAndResources.
2021-12-22 11:14:09 +03:00
Kubernetes Prow Robot
8324868f89 Merge pull request #106950 from sunzhaochang/fix-unexpected-end-test
Fix unexpected end of TestDependentsRace
2021-12-14 15:16:49 -08:00
sunzhaochang
f0e74bfb7f Fix unexpected end of TestDependentsRace 2021-12-10 20:07:37 +08:00
Davanum Srinivas
9405e9b55e Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-09 21:31:26 -05:00
Mikhail Mazurskiy
de4598d0db ResettableRESTMapper to make it possible to reset wrapped mappers 2021-11-06 10:44:02 +11:00
Manu Gupta
79a51090f9 fix: 81134: fix unsafe json for ReleaseControllerRevision (#104049)
* fix: 81134: fix unsafe json for ReleaseControllerRevision

1. Ensures that ReleaseControllerRevision returns a proper json by
marshalling an object into bytes. Otherwise, it returns an error.

2. Also, refactors the code to commonize the merge type
   GenerateDeleteOwnerRefStrategicMergeBytes that returns a byte and is
   used across ReleasePod, ReleaseControllerRevison
   ReleaseReplicaSet.

* Move GeneratePatchBytesForDelete to controller_ref_manager
2021-11-05 06:33:52 -07:00
Mike Dame
4960d0976a Wire contexts to Core controllers 2021-11-01 10:29:00 -04:00
Kubernetes Prow Robot
8ac9526475 Merge pull request #101928 from alexanderConstantinescu/drain-workqueue
client-go/workqueue: Drain work queue on shutdown
2021-09-10 18:02:06 -07:00
Jiahui Feng
8f5771d243 use common controller interface in KCM. 2021-08-25 13:29:03 -07:00
Stephen Augustus
481cf6fbe7 generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
Alexander Constantinescu
5b740f430e [queue] Implement ShutDownWithDrain allowing the queue to drain when shutting down
Signed-off-by: Alexander Constantinescu <aconstan@redhat.com>
2021-08-20 13:59:12 +02:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Jordan Liggitt
1e71a28490 Clean up namespaced children of missing virtual parents with incorrectly cluster-scoped nodes 2021-01-14 11:29:31 -05:00