apiserver/pkg/server
Patrick Ohly d712a4ee7e apimachinery runtime: support contextual logging
In contrast to the original HandleError and HandleCrash, the new
HandleErrorWithContext and HandleCrashWithContext functions properly do contextual
logging, so if a problem occurs while e.g. dealing with a certain request and
WithValues was used for that request, then the error log entry will also
contain information about it.

The output changes from unstructured to structured, which might be a breaking
change for users who grep for panics. Care was taken to format panics
as similar as possible to the original output.

For errors, a message string gets added. There was none before, which made it
impossible to find all error output coming from HandleError.

Keeping HandleError and HandleCrash around without deprecating while changing
the signature of callbacks is a compromise between not breaking existing code
and not adding too many special cases that need to be supported. There is some
code which uses PanicHandlers or ErrorHandlers, but less than code that uses
the Handle* calls.

In Kubernetes, we want to replace the calls. logcheck warns about them in code
which is supposed to be contextual. The steps towards that are:
- add TODO remarks as reminder (this commit)
- locally remove " TODO(pohly): " to enable the check with `//logcheck:context`,
  merge fixes for linter warnings
- once there are none, remove the TODO to enable the check permanently

Kubernetes-commit: 5a130d2b71e5d70cfff15087f4d521c6b68fb01e
2023-11-20 20:25:00 +01:00
..
dynamiccertificates api-machinery: stop using deprecated io/ioutil 2023-05-02 15:08:18 +02:00
egressselector cleanup: omit comparison with bool constants 2023-09-04 16:59:23 +08:00
filters apimachinery runtime: support contextual logging 2023-11-20 20:25:00 +01:00
healthz k8s.io/apiserver: refactor GenericAPIServer healthz code. 2023-11-15 12:36:04 -08:00
httplog apiserver/httplog: pretty up impersonation output 2023-08-07 11:23:30 +02:00
mux Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
options Add metrics for authentication config reload 2024-03-09 13:29:56 -08:00
resourceconfig reduce API surface area of whether a resource is enabled 2022-02-21 17:23:19 -05:00
routes Register metrics for apiserver handlers 2023-09-06 17:25:12 +00:00
storage Remove storageConfig.Paging parameter 2023-10-20 15:35:58 +02:00
config.go Implement authz config file reloading 2023-11-08 08:49:58 -06:00
config_selfclient.go Move the comment to the right line 2021-04-23 00:05:15 +00:00
config_selfclient_test.go run hack/update-netparse-cve.sh 2021-08-20 01:16:14 +02:00
config_test.go Restrict supported media types for new apiservers. 2023-10-17 14:06:46 -04:00
deleted_kinds.go Switch deprecated API serving back to gating on beta 2022-11-15 22:02:49 -05:00
deleted_kinds_test.go replace spew methods with dump methods 2023-04-13 09:41:07 +08:00
deprecated_insecure_serving.go Set idle and readheader timeouts 2021-07-27 11:58:45 -04:00
doc.go
genericapiserver.go Use v2 types with agg discovery 2024-01-19 16:13:47 -05:00
genericapiserver_graceful_termination_test.go api-machinery: stop using deprecated io/ioutil 2023-05-02 15:08:18 +02:00
genericapiserver_test.go api-machinery: stop using deprecated io/ioutil 2023-05-02 15:08:18 +02:00
graceful_shutdown_test.go api-machinery: stop using deprecated io/ioutil 2023-05-02 15:08:18 +02:00
handler.go Fix gorestful typos in the APIServerHandler.Director docstring 2023-01-14 12:10:00 -05:00
healthz.go k8s.io/apiserver: refactor GenericAPIServer healthz code. 2023-11-15 12:36:04 -08:00
healthz_test.go Migrate to k8s.io/utils/clock in apiserver 2021-09-14 20:36:07 +02:00
hooks.go Generate and format files 2022-07-19 20:54:13 -04:00
lifecycle_signals.go apiserver: watch gets notified on server shutdown signal 2023-01-13 18:02:41 -05:00
plugins.go refactor: move vap into parent `policy` folder 2024-01-17 18:09:30 -08:00
secure_serving.go Prevent rapid reset http2 DOS on API server 2023-10-07 21:50:37 -04:00
signal.go make Kubelet bootstrap certificate signal aware 2020-07-04 12:08:04 +08:00
signal_posix.go generated: Run hack/update-gofmt.sh 2021-08-12 17:13:11 -04:00
signal_windows.go