Commit Graph

835 Commits

Author SHA1 Message Date
Monis Khan 9bbffa3c76 kmsv1: attempt AES-GCM before AES-CBC on reads
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: 5137fb00b6fb47445727a1fa2897e0eaaadaeeb8
2023-07-17 16:22:17 -04:00
Monis Khan 6cfe489651 Clear front proxy headers after authentication is complete
This matches the logic we have for the Authorization header as well
as the impersonation headers.

Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: 7b711c5cf4d6721e9742baf5ebfafee42f645789
2023-03-20 13:11:38 -04:00
root 470f61b9ca Fixes the issue #114145
Kubernetes-commit: db2e97f8088d787bf59cb4b96a6ab5457ef13e24
2023-01-10 04:49:49 +00:00
Jordan Liggitt b3ad9fb4e3 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

Replay of a9593d634c6a053848413e600dadbf974627515f

Kubernetes-commit: 15d9d196476d64482189f00f1cf1a2061aea5b35
2022-11-16 11:39:18 -05:00
Joseph Anttila Hall 41ac89bf47 egress_selector: prevent goroutines leak on connect() step.
Kubernetes-commit: 6b875d8902e7e87be1ffdfcfb065636ac1d0bbda
2022-11-01 21:55:42 -07:00
Mikhail Mazurskiy 8451acee4f Always dial using a context
Kubernetes-commit: 1a6a25bb3d9f8e0c3e1c7feea884b832b0167d74
2022-05-18 10:39:35 +10:00
Artur Żyliński 71b30218e5 Always log APF InitialSeats and FinalSeats values
Add apf_additionalLatency field, to have all WorkEstimate data

Kubernetes-commit: ed780fb06ebb401f599db1dc9295c73bbc1f565f
2022-07-13 10:38:11 +02:00
Vladimir Nachev 7013f45ebc Ensure the dir of --audit-log-path exists
Signed-off-by: Vladimir Nachev <vladimir.nachev@sap.com>

Kubernetes-commit: b83d6aa37d152a3728eb041faefe0ec83be6bb32
2022-06-27 17:21:02 +03:00
Paco Xu e389c500bd TestPreShutdownHooks: change timeout to 1s
Kubernetes-commit: 99c447ff0e93157bf0760498c4090483162e7cf5
2022-03-30 10:18:56 +08:00
Jefftree e4486afb41 Separate OpenAPI V2 and V3 Config
Kubernetes-commit: 67d3dbfaae87a5bf3325fadda7266ed223766a53
2022-03-28 13:18:56 -07:00
Anish Ramasekar e442eafb33 feat: prepare KMS data encryption for migration to AES-GCM
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
Co-authored-by: Monis Khan <mok@vmware.com>
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: 90b42f91fd904b71fd52ca9ae55a5de73e6b779a
2022-03-16 17:54:10 +00:00
Abu Kashem af86802d1a apiserver: stop http server after pre shutdown hooks
Kubernetes-commit: 8d96cc2dfbd650544660e41c5e8efc8d1e1033a3
2022-02-09 16:40:57 -05:00
Tim Allclair 1e36b0a9fb Don't add audit annotations directly to the audit event
Kubernetes-commit: bdebc62d49293a0fbbd7e0d95bfd94b1ce21015c
2022-03-28 11:38:38 -07:00
Abu Kashem 1b651c5994 add latency tracker for storage and transform
Kubernetes-commit: eca90856940e9251ecf3fde95c5e4d2d16f5ad68
2022-02-01 18:13:03 -05:00
Patrick Ohly ba3b8e9322 enhance and fix log calls
Some of these changes are cosmetic (repeatedly calling klog.V instead of
reusing the result), others address real issues:

- Logging a message only above a certain verbosity threshold without
  recording that verbosity level (if klog.V().Enabled() { klog.Info... }):
  this matters when using a logging backend which records the verbosity
  level.

- Passing a format string with parameters to a logging function that
  doesn't do string formatting.

All of these locations where found by the enhanced logcheck tool from
https://github.com/kubernetes/klog/pull/297.

In some cases it reports false positives, but those can be suppressed with
source code comments.

Kubernetes-commit: edffc700a43e610f641907290a5152ca593bad79
2022-02-16 12:17:47 +01:00
Maciej Wyrzuc 253e375283 Copy request in timeout handler
Kubernetes-commit: 44705c71401d327c6d596597adc55596973e89d0
2022-02-24 13:42:32 +00:00
Wojciech Tyczyński abc4243fac Record dropped requests in apiserver_request_total metric
Kubernetes-commit: 14396349954be57abea7162d7fe091e58a80ec4b
2022-03-23 16:16:36 +01:00
kerthcet 6316e03e25 fix: race detected in TestErrConnKilled
Signed-off-by: kerthcet <kerthcet@gmail.com>

Kubernetes-commit: dd75d3b9ecca72968bcb7ce50b39ec00e7415b41
2022-03-24 01:48:49 +08:00
Ravi Gudimetla 1ee261d219 API Server Changes
This commit includes all the changes needed for APIServer. Instead of modifying the existing signatures for the methods which either generate or return stopChannel, we generate a context from the channel and use the generated context to be passed to the controllers which are started in APIServer. This ensures we don't have to touch APIServer dependencies.

Kubernetes-commit: 8b84a793b39fed2a62af0876b2eda461a68008c9
2022-03-07 09:20:45 -05:00
Kermit Alexander c679395394 Add maxLength/maxItems/maxProperties support to cel.Compile.
Kubernetes-commit: 83e4d192b136ac3a28ea26a9d09dc9fee7c6b665
2022-02-15 08:49:37 +00:00
ialidzhikov 38f395ca57 apiserver: Remove the deprecated `--deserialization-cache-size` flag
Signed-off-by: ialidzhikov <i.alidjikov@gmail.com>

Kubernetes-commit: ee2530ffd4db0cdc8384f7d4acb014e79bb224e9
2022-03-02 15:33:21 +02:00
jupblb c0c615eb7a Remove apf_fd from httplog
Since flowDistinguisher may hold data identifying a user accessing the
cluster this can be a source of a PII leak.

Kubernetes-commit: 94c92f78e5b02c27502f3b9d59b4e194e476a6f4
2022-03-10 12:59:00 +01:00
carlory 871a4b7200 remove audit.k8s.io/v1[alpha|beta]1 versions
Kubernetes-commit: fcc282f9f2050aaa4007d6f0444b0f4972925fea
2022-02-13 13:23:49 +08:00
ialidzhikov bce3488a65 apiserver: Remove the deprecated `--target-ram-mb` flag
Signed-off-by: ialidzhikov <i.alidjikov@gmail.com>

Kubernetes-commit: bdbc7501293eac721ea6f77b55918652f2cd6aab
2022-03-02 18:52:46 +02:00
ialidzhikov aa165d392e apiserver: Remove the deprecated `--experimental-encryption-provider-config` flag
Signed-off-by: ialidzhikov <i.alidjikov@gmail.com>

Kubernetes-commit: 244bf1bd69c962041ba5cabc3c9e92f3f94a3ba4
2022-03-01 19:21:18 +02:00
David Eads 388a62292f prevent enabling beta by default for new api groups
Kubernetes-commit: af99d192cf95cd29e455d186878db409b8cbdf2c
2022-02-07 13:32:01 -05:00
David Eads 57ccdb5af8 reduce API surface area of whether a resource is enabled
Kubernetes-commit: a59b92e8c039fb3646dec18f9e64ee2b5462db42
2022-02-21 17:23:19 -05:00
David Eads 7fd5822a08 migrate more rest handlers to select by resource enablement
Kubernetes-commit: 0ec20f97d27e08be8d8bbbbff52e68a4409ab43c
2022-02-21 16:10:25 -05:00
Steve Kuznetsov af1cb1cefe storage: transformers: pass a context.Context
When an envelope transformer calls out to KMS (for instance), it will be
very helpful to pass a `context.Context` to allow for cancellation. This
patch does that, while passing the previously-expected additional data
via a context value.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 27312feb9983c18d1daf00afba788727d024cdd0
2022-02-17 07:29:44 -08:00
Wojciech Tyczyński 5e8e1ff118 Relax to using namer instead of selflinker in API groupversion
Kubernetes-commit: 0ad588b27b6845d9ece955bfdde0e2863b8e1394
2022-01-13 16:34:56 +01:00
David Eads 1452003cc5 update resourceconfig to have per-resource preferences take priority
Kubernetes-commit: 41b2662bac7a80d41dfbab13d72c9e1557c0f613
2022-02-09 15:44:47 -05:00
David Eads 28da9a6848 update the --runtime-config handling to ensure that user preferences always take priority over hardcoded preferences
Kubernetes-commit: e378fd2bae0fec4756a8e755395193337d13caa2
2022-02-09 13:05:12 -05:00
brianpursley 21a4aa1138 Fix wrong status code in unit test error messages.
Replace deprecated use of diff.ObjectReflectDiff() with cmp.Diff().

Kubernetes-commit: e9211d3279649795e40d9698f05e9752d111024a
2022-01-25 20:31:47 -05:00
Abu Kashem dc55a1a6cc fix flake in TestTimeoutHeaders
Kubernetes-commit: 2ae70e85d27ad30c29084b56572a817bc18b42e1
2022-02-07 10:34:20 -05:00
Abu Kashem 72aa2c42fc refactor: rename webhook duration tracker
Kubernetes-commit: 4a9b9028153c6984b9cf69067cc0a1aa12a00e73
2022-02-01 15:44:59 -05:00
Patrick Ohly ec795ae204 avoid klog Info calls without verbosity
In the following code pattern, the log message will get logged with v=0 in JSON
output although conceptually it has a higher verbosity:

   if klog.V(5).Enabled() {
       klog.Info("hello world")
   }

Having the actual verbosity in the JSON output is relevant, for example for
filtering out only the important info messages. The solution is to use
klog.V(5).Info or something similar.

Whether the outer if is necessary at all depends on how complex the parameters
are. The return value of klog.V can be captured in a variable and be used
multiple times to avoid the overhead for that function call and to avoid
repeating the verbosity level.

Kubernetes-commit: 9eaa2dc554e0c3d4485d4c916dfdbc2f517db2e0
2021-12-11 12:10:21 +01:00
Jordan Liggitt 0edf32708d Fix header mutation race in timeout filter
Kubernetes-commit: 5b2a31f375755386b5cb2541b912f3561f7d6431
2022-01-04 22:57:29 -05:00
Ben Luddy 681941e62b Don't bypass ResponseWriter wrappers for apiserver healthz errors.
The effective layering of ResponseWriters is today, from outside to
inside, httplog(timeout(audit(metrics(original)))). From
6e3fd91e1aa3259d7bd67e0a65693e346ade347d, calls to http.Error in the
apiserver's root healthz handler use an unwrapped ResponseWriter --
effectively timeout(audit(metrics(original))) -- to avoid logging
stack traces for those requests.

From 0d50c969c587c8a6c16e0962118305ac652c5a6b, the same call to
http.Error receives a completely-unwrapped ResponseWriter. This has
the effect of bypassing not only the httplog wrapper, but also
timeout, audit, and metrics. The timeout wrapper defends against
the (disallowed) use of underyling ResponseWriter after the completion
of its request's ServeHTTP call. Since that defensive behavior is
being bypassed, it's possible for the root healthz handler to panic
when health probes time out.

Instead of continuing to use a wrapper-aware means of disabling stack
traces, this commit adds a new function to httplog that allows
customization of the stack trace logging predicate on a per-request
basis.

Kubernetes-commit: ff849fe8b688606d5173d5ee0213a96cffae23c0
2021-12-14 16:23:36 -05:00
Pingan2017 41eb079182 Remove args enable-swagger-ui since no effect from 1.14
Kubernetes-commit: 206f3aeec2748ef149a36a9c69329b5be2953ecb
2021-09-15 10:32:35 +08:00
Mateusz Gozdek fa92f23eb9 k8s.io/apiserver/pkg/server: fix name in APIServerHandler description
In 18177e2bdeafbddeb3d66fec0b8cb88794cd69ff, PostGoRestful field has
been renamed to NonGoRestfulMux, but the documentation change did not
follow.

This commit fixes that to avoid potential confusion.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

Kubernetes-commit: 36ede8de945adcc06bde21c49dc157e9c741e0d2
2021-10-04 14:54:14 +02:00
William Zhang c0fcf30dd4 cleanup(apiserver): delete the --max-resource-write-bytes & --json-patch-max-copy-bytes description.
Change-Id: I0fe27dce27db6a1e186bd44a968c6e931de88dd8
Signed-off-by: William Zhang <warmchang@outlook.com>

Kubernetes-commit: 584165cfcc861bc0c8911e11347734cfc8feb8c8
2021-12-08 17:12:37 +08:00
Davanum Srinivas b840d63feb Cleanup OWNERS files (No Activity in the last year)
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 497e9c1971c9e7d0193bc6d11503ec4ad527f1d5
2021-12-10 15:18:50 -05:00
Arda Güçlü 1fbc8d31a2 Rename ServeWithListenerStopped to Serve in secure_serving
This PR removes Serve function and uses all required places
ServeWithListenerStopped which takes place new Serve function.

This function returns ListenerStopped channel can be used to drain
requests before shutting down the server.

Kubernetes-commit: a8d2b3a7926394b1c53621804cdeb93e4a61b7c8
2021-11-08 17:20:31 +03:00
Abu Kashem 6bd59a523a apf: add a metric to count seat samples
Kubernetes-commit: bb15bdf15c1cc4d5a4380f3f6ed46d4adc9662a1
2021-11-23 11:36:09 -05:00
Abu Kashem b88c96a347 apf: add initial and final seats to httplog
Kubernetes-commit: be085b63455738d3f89fd804c84ae7ab0ac81008
2021-11-23 10:26:10 -05:00
Abu Kashem 1d83e4074a apf: ensure exempt request notes the classification
Kubernetes-commit: 8b2dd74c277d6a56a14e99830d39b23c5788c62e
2021-12-05 11:29:15 -05:00
Davanum Srinivas 56a3a30ae1 Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9405e9b55ebcd461f161859a698b949ea3bde31d
2021-12-09 21:31:26 -05:00
Andy Goldstein b6300d119d Improve pathrecorder duplicate registration info
Print information from both the original path registration and the new
path registration stack traces when encountering a duplicate. This helps
the developer determine where the duplication is coming from and makes
it much easier to resolve.

Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>

Kubernetes-commit: 04aa8f9dcdbc575fde37e25e45315359b0aa1ca6
2021-12-03 14:42:27 -05:00
Sergey Kanzhelev 95790548cb remove ReallyCrashForTesting and cleaned up some references to HandleCrash behavior
Kubernetes-commit: a11453efbc4a5575f7945af1c6fd4f7c00379529
2021-05-04 00:10:11 +00:00
Antonio Ojea 2f6960cc90 remove unused variable responseBodySize
Kubernetes-commit: 9336ff78f4a95cca8eb4a5cf528812d1bcac552c
2021-11-16 22:49:22 +01:00