288 Commits
Author SHA1 Message Date
Michael Aspinwall 2b96ebcfe0 Move consistency store to client-go utils 2026-09-30 20:22:05 +00:00
Patrick Ohly 6facac2705 kube-controller-manager: pass context to all constructors
This is for consistency with other controller constructors which truly need a
context already during construction because they spawn goroutines. Constructors
which don't do that (yet) can trivially retrieve the logger with FromContext.
2026-09-08 15:14:33 +02:00
Patrick Ohly 2579861734 kube-controller-manager: use context-aware client-go
Kubernetes 1.37 finished the introduction of context-aware client-go APIs.
Components like kube-controller-manager which are meant to support contextual
logging should use those new APIs.

This is not enforced yet because existing code must be updated first. Once
that is done, enforcement of everything touched here can be enabled tree-wide.
2026-09-07 16:49:09 +02:00
Joe Betz e89ecc6af0 generate 2026-06-30 18:02:28 -04:00
Joe Betz 119a1460c1 Generate deepcopy 2026-05-11 12:27:56 -04:00
Michael Aspinwall f18f0df7fe Add the ability for the replicaset controller to read its own writes 2026-02-25 17:15:53 +00:00
Filip Křepinský b7d16fea7f disable terminatingReplicas reconciliation in ReplicationController 2025-05-30 21:08:12 +02:00
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
Joe Betz 2595aa1309 generate 2024-09-03 14:26:26 -04: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
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
HirazawaUi 397cc73dc9 delete unused functions in pkg/controller directory 2023-03-28 22:41:20 +08:00
Naman Lakhwani 8f45b64c93 Migrated pkg/controller/replicaset to contextual logging (#114871)
* migrated controller/replicaset to contextual logging

Signed-off-by: Naman <namanlakhwani@gmail.com>

* small nits

Signed-off-by: Naman <namanlakhwani@gmail.com>

* addressed changes

Signed-off-by: Naman <namanlakhwani@gmail.com>

* small nit

Signed-off-by: Naman <namanlakhwani@gmail.com>

* taking t as input

Signed-off-by: Naman <namanlakhwani@gmail.com>

---------

Signed-off-by: Naman <namanlakhwani@gmail.com>
2023-03-07 04:19:51 -08:00
Daniel Smith 8100efc7b3 Enable propagration of HasSynced
* Add tracker types and tests
* Modify ResourceEventHandler interface's OnAdd member
* Add additional ResourceEventHandlerDetailedFuncs struct
* Fix SharedInformer to let users track HasSynced for their handlers
* Fix in-tree controllers which weren't computing HasSynced correctly
* Deprecate the cache.Pop function
2022-12-14 18:43:33 +00:00
Alexander Zielenski 063ef090e7 switch listeners to use a map, adapt tests 2022-08-08 14:01:10 -07:00
Uwe Krueger 92f04baac9 apply desired changes for handler registration 2022-08-08 14:01:09 -07:00
Uwe Krueger 7054ac16d4 rename handle to registration 2022-08-08 14:01:09 -07:00
Alexander Zielenski 7436af3302 support removal of event handlers from SharedIndexInformers
To be able to implement controllers that are dynamically deciding
on which resources to watch, it is required to get rid of
dedicated watches and event handlers again. This requires the
possibility to remove event handlers from SharedIndexInformers again.
Stopping an informer is not sufficient, because there might
be multiple controllers in a controller manager that independently
decide which resources to watch.

Unfortunately the ResourceEventHandler interface encourages to use
value objects for handlers (like the ResourceEventHandlerFuncs
struct, that uses value receivers to implement the interface).
Go does not support comparison of function pointers and therefore
the comparison of such structs is not possible, also. To be able
to remove all kinds of handlers and to solve the problem of
multi-registrations of handlers a registration handle is introduced.
It is returned when adding a handler and can later be used to remove
the registration again. This handle directly stores the created
listener to simplify the deletion.
2022-08-08 14:01:09 -07:00
Wojciech Tyczyński 11b679c66a Fix event broadcaster shutdown in multiple controllers 2022-05-17 22:14:19 +02: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
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
Mike Dame 80c01707e0 Wire contexts to Batch controllers (#105491)
* Wire contexts to Batch controllers

* (hold) feedback + updates that overlap with Apps controllers

* fixup errors
2021-11-10 14:56:46 -08:00
Maciej Szulik 1fb6bf8a14 Wire context instead of TODO 2021-10-12 13:21:45 +02: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
Aldo Culquicondor d8aad7944c Remove unused util CreatePods
And rename CreatePodsWithControllerRef to simply CreatePods
2021-05-20 20:27:21 +00:00
Aldo Culquicondor 6fc5fc0c86 Remove unused CreatePodsOnNode function
Remnant of old daemonset controller
2021-04-15 18:53:36 +00:00
Joe Betz 29423501f0 Add apply subresource support to client-go's typed client 2021-04-05 12:27:42 -07:00
Joe Betz 293e07a836 Add Apply functions to client-gen 2021-03-06 20:49:06 -05:00
Benjamin Elder 56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Kobayashi Daisuke 4ecbec75a6 Run update-bazel.sh 2020-06-22 10:49:15 +09:00
Kobayashi Daisuke 4ae11dac2e Replace StartLogging(klog.Infof) with StartStructuredLogging(0) 2020-06-15 17:48:35 +09:00
Davanum Srinivas 07d88617e5 Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04:00
Davanum Srinivas 442a69c3bd switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Mike Danese bfc75d9a5c manual fixes 2020-02-08 12:32:33 -05:00
Mike Danese 2637772298 some manual fixes 2020-02-07 18:17:40 -08:00
Mike Danese 3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
wojtekt 7b6bcdf780 Autogenerated code 2019-10-24 20:21:00 +02:00
Kenneth Owens f81fc8ae1b Updates OWNERS files and OWNERS_ALIASES for SIG Apps to make reviewers
and approvers more clear
2019-04-16 11:35:21 -07:00
stewart-yu ecbd5427e7 auto-generated file 2019-03-02 12:55:26 +08:00
stewart-yu e01ff1641c move config local to every controllers in kube-controller-manager 2019-03-02 12:54:33 +08:00
Kubernetes Prow Robot 808f2cf0ef Merge pull request #72525 from justinsb/owners_should_not_be_executable
Remove executable file permission from OWNERS files
2019-02-14 23:55:45 -08:00
Roy Lenferink b43c04452f Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
Justin SB dd19b923b7 Remove executable file permission from OWNERS files 2019-01-11 16:42:59 -08:00
Jordan Liggitt 0ff455e340 generated files 2018-12-19 11:19:12 -05:00
Jordan Liggitt fd9e9b01b1 Remove uses of extensions/v1beta1 clients 2018-12-19 11:18:53 -05:00
Davanum Srinivas 954996e231 Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Jordan Liggitt 572dfe6cb7 generated files 2018-10-25 21:12:57 -04:00
Jordan Liggitt dda0a68521 Change registration and custom conversion from extensions to apps 2018-10-25 21:12:57 -04:00
Davanum Srinivas 9b43d97cd4 Add Labels to various OWNERS files
Will reduce the burden of manually adding labels. Information pulled
from:
https://github.com/kubernetes/community/blob/master/sigs.yaml

Change-Id: I17e661e37719f0bccf63e41347b628269cef7c8b
2018-08-21 13:59:08 -04:00
Clayton Coleman ba95744bc5 Make conversion function names match expected values 2018-07-17 23:02:16 -04:00