Commit Graph

15 Commits

Author SHA1 Message Date
Filip Křepinský
b768967280 move aliases into each registrable controller 2023-10-27 13:28:02 +02:00
Filip Křepinský
27a77e0ef3 Encapsulate KCM controllers with their metadata
- These metadata can be used to handle controllers in a generic way.
- This enables showing feature gated controllers in kube-controller-manager's help.
- It is possible to obtain a controllerName in the InitFunc so it can be passed down to and used by the controller.

metadata about a controller:
- name
- requiredFeatureGates
- isDisabledByDefault
- isCloudProviderController
2023-10-27 13:28:01 +02:00
Patrick Ohly
02efe09abe component-base/logs: improve handling of re-applying a configuration
Normal binaries should never have to do this. It's not safe when there are
already some goroutines running which might do logging. Therefore the new
default is to return an error when a binary accidentally re-applies.

A few unit ensure that there are no goroutines and have to call the functions
more then once. The new ResetForTest API gets used by those to enable changing the
logging settings more than once in the same process.

Integration tests use the same code as the normal binaries. To make reuse of
that code safe, component-base/logs can be configured to silently ignore any
additional calls. This addresses data races that were found when enabling -race
for integration tests. To catch cases where the integration test does want
to modify the config, the old and new config get compared and an error is
raised when it's not the same.

To avoid having to modify all integration tests which start test servers,
reconfiguring component-base/logs is done by the test server packages.
2023-07-05 19:08:54 +02:00
Filip Křepinský
9730951136 introduce KCM controller aliases and unify controller names 2023-06-19 14:59:33 +02: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
Lucas Severo Alves
096d2e5895 remove unwanted newlines 2023-01-24 21:45:32 +01:00
Lucas Severo Alves
636f8e1a3e chore: changes needed before #111155 2023-01-24 17:55:32 +01:00
Jordan Liggitt
78cb3862f1
Fix indentation/spacing in comments to render correctly in godoc 2022-12-17 23:27:38 -05:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
Wojciech Tyczyński
1f4f98e40d Clean shutdown of cloud controllers in integration tests 2022-07-25 11:28:50 +02:00
ahrtr
972dc46a1f replace deprecated io/ioutil with os and io for cmd 2022-02-01 13:59:41 +08:00
Jian Zeng
e481d99965
refactor: disable insecure serving in controller-manager
Now the following flags have no effect and would be removed in v1.24:
* `--port`
* `--address`

The insecure port flags `--port` may only be set to 0 now.

Signed-off-by: Jian Zeng <zengjian.zj@bytedance.com>
2021-05-03 00:01:49 +08:00
Mike Danese
d55d6175f8 refactor 2020-01-29 08:50:45 -08:00
Dr. Stefan Schimanski
4860f8732a testservers: return Run method errors correctly 2018-11-06 15:14:24 +01:00
Dr. Stefan Schimanski
e209b643a7 kube-controller-manager: add test server and test serving 2018-08-30 20:16:39 +02:00