Commit Graph

2792 Commits

Author SHA1 Message Date
Clayton Coleman 03e6089ce8 wait: Use a context implementation for ContextForChannel
ContextForChannel uses a goroutine to transform a channel close to
a context cancel. However, this exposes a synchronization issue if
we want to unify the underlying implementation between contextless
and with context - a ConditionFunc that closes the channel today
expects the behavior that no subsequent conditions will be invoked
(we have a test in wait_test.go TestUntilReturnsImmediately that
verifies this expectation). We can't unify the implementation
without ensuring this property holds.

To do that this commit changes from the goroutine propagation to
implementing context.Context and using stopCh as the Done(). We
then implement Err() by returning context.Canceled and stub the
other methods. Since our context cannot be explicitly cancelled
by users, we cease to return the cancelFn and callers that need
that behavior must wrap the context as normal.

This should be invisible to clients - they would already observe
the same behavior from the context, and the existing error
behavior of Poll* is preserved (which ignores ctx.Err()).

As a side effect, one less goroutine is created making it more
efficient.

Kubernetes-commit: 95051a63b323081daf8a3fe55a252eb79f0053aa
2023-01-17 15:01:02 -05:00
Alexander Zielenski 73db86feab fix bug with param controllers being removed if used by more than one policy
Kubernetes-commit: ecd267d097ec7cd26fa5a6343622c3772f66486f
2023-01-17 15:27:45 -08:00
SataQiu 0f00ee135b the AdvancedAuditing featuregate has been GA since v1.12, and is locked to ture in v1.27
Kubernetes-commit: c25095b2231eb64ac938ae8b3d939c76307da340
2023-01-18 18:50:15 +08:00
Andrew Sy Kim 885060394e apiserver: use the identity value in the apiserver identity hash
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>

Kubernetes-commit: a7de3e15a50bafdd65adf55f5fdc14567e3fa3e2
2023-01-13 15:49:30 -05:00
Andrew Sy Kim 2d94c4699b apiserver: update lease identity prefix from kube-apiserver- to apiserver-
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>

Kubernetes-commit: fb066a883de2b56e533eb622677056bd723748ce
2022-12-19 13:33:24 -05:00
lengrongfu 7deda7bdcd clean up master-service-namespace
Signed-off-by: lengrongfu <rongfu.leng@daocloud.io>

Kubernetes-commit: 556d3fc2b7b4dfd1d94d3039909ddb42d88f7c52
2022-12-13 18:13:16 +08:00
Alexander Zielenski 9be70531b4 refactor admission controller to avoid contention
refresh admission policies up to once per second based upon last known good data

Kubernetes-commit: 5f59f449832e5206fe9b5fd7d9a43721c4c9ae44
2022-12-15 16:30:52 -08:00
Alexander Zielenski 3fe59ceb77 defer Done call
safer in case of panic

Kubernetes-commit: 517df8f3051b5b0a9eb57a5bad1d6bc16fb61985
2022-12-15 13:09:11 -08:00
Paco Xu d49ebea4e2 cleanup: EphemeralContainers feature gate related codes
Kubernetes-commit: 70e56fa71af5aa4f3d1448fcbc26e86309cd0cf3
2022-12-16 23:46:47 +08:00
Krzysztof Ostrowski a85078bf03 apiserver/kmsv2: mv Service interface into kmsv2
Signed-off-by: Krzysztof Ostrowski <kostrows@redhat.com>

Kubernetes-commit: b7701b00eaa8cdc2103beb8ab78f625cc3b62d90
2023-01-09 14:36:06 +01:00
Antoine Pelisse 9451c13844 fieldmanager: remove dependencies on internal
Remove dependencies on internal fieldmanager for admission things. This
is preparing for moving fieldmanager out, but the admission part will
stay here, so it can't depend directly on internal.

Kubernetes-commit: d13b405307262b2b9c0795af3a22d0a5725ef6a0
2022-12-21 15:46:49 -08:00
Daniel Smith f1c42beb68 Fix N^2 startup for webhook configurations
Add a "lazy" type to track when an update is needed. It uses a nested
locking technique to avoid extra evaluation calls.

Kubernetes-commit: 5a1091d88d95bd1dd5c27f2c72cee4ecb4219dda
2023-01-09 23:29:25 +00:00
Monis Khan ebb0d405b3 encryption-at-rest: clean up context usage and duplicated code
This change in a no-op refactor of the encryption at rest code that
primarily changes the wiring to consistently use context for
lifecycle management (instead of a mixture of context and stop
channels).

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

Kubernetes-commit: 70b414b0e5cbe9706e5a4fc0d7299ec6b169d642
2022-11-09 17:33:38 -05:00
Paco Xu d61f1147f3 remove psp in extensions api/apis
Kubernetes-commit: 25686a2c772adea2088f3be087280c39daa81631
2022-11-02 21:12:43 +08:00
Antoine Pelisse 652037afcf fieldmanagertest: Reduce API surface of the test package
Kubernetes-commit: 7899157345a9ef02bacc56898055e98f28d5b9cc
2022-12-15 20:50:38 -08:00
Antoine Pelisse 4079852d5b fieldmanager: Remove obsolete comment
Kubernetes-commit: ad65b25cc33b7323d6651407944fe74d938ac42a
2022-12-15 16:42:40 -08:00
Antoine Pelisse b02ebf4b97 Make internal managers private
This significantly reduces the surface area of the fieldmanager package
by hiding all the private "managers" objects, as well as the interface
that was made specifically for these. There is no reason to configure
these.

Kubernetes-commit: adfc65ec23292ebd95d96727654acd8e8e0452a5
2022-12-12 14:07:13 -08:00
Abu Kashem 9e60654b8a apiserver: refactor WithWaitGroup handler
Kubernetes-commit: 9093f126b87cb686784bb27b08be9eb12b4d5453
2023-01-10 15:55:19 -05:00
root d7c195333e Fixes the issue #114145
Kubernetes-commit: 0f186fd6d8a38601effd443bd4a23dea75e2c033
2023-01-10 04:49:49 +00:00
Jordan Liggitt b0b89e7e65 Prune trailing newlines when enums are disabled
Kubernetes-commit: d0967bbe5e78dbcdd5bc189d5fc2becafc4be0f2
2023-01-06 00:58:23 -05:00
Jefftree deb6c803a5 Add jefftree to OWNERS
Kubernetes-commit: 6b443c2304e22801438a94b0b62f6d5b7c1dc020
2022-11-16 19:12:45 +00:00
Joseph Anttila Hall f1f1cdab79 egress_selector.go: register konnectivity-client metrics.
This registers new metrics provided by https://github.com/kubernetes/kubernetes/pull/114789.

Kubernetes-commit: 43a6eba33bea2712ddef0f8191fb47ebc322c59e
2023-01-04 18:38:22 +00:00
Antoine Pelisse 234f6c3879 Give TypeConverter to TestFieldManager
This is mostly because the path, even for built-in, can change from test
to test, so it's easier to make the whole thing configurable anyway.

Kubernetes-commit: 1617b06c039cb66f05e59b79f9a9963d5614ce31
2022-12-13 14:30:45 -08:00
Antoine Pelisse 94f827cb28 Hide OpeAPI details behind the NewTypeConverter
The fact that we're building the OpenAPI using the proto.Models is an
implementation detail that we shouldn't have to expose. Since we're
going to change the way this is transformed, let's first hide it behind
the common NewTypeConverter so that the next change is transparent.

This will also enable other clean-ups like hiding the gvkParser which
shouldn't be exposed and prevent some refactoring.

Kubernetes-commit: a7ab6b86db83e31ff599e4d21a065f6845fb93dd
2023-01-03 14:26:06 -08:00
kkkkun c465dcc9ec Fix normal request metric verb correctly
Signed-off-by: kkkkun <scuzk373x@gmail.com>

Kubernetes-commit: 0b6e641810fb7a24a74b8068fb772c1bb1eb447c
2023-01-03 13:16:46 +00:00
Arda Güçlü ca82ee6238 Remove GetSingularName for subresources
Kubernetes-commit: 1abf94bec30706afbbeae7e4a1cbf4dbacbaa422
2022-11-18 09:55:18 +03:00
Arda Güçlü d20862a68e Add singular name for the rest of types
Kubernetes-commit: 578ddde80e72a300fdb3798d68e550d2b4a61203
2022-11-03 10:18:45 +03:00
Arda Güçlü da3d6b945b Introduce singularNameProvider for core types
This introduces `singularNameProvider`. This provider will be used
by core types to have their singular names are defined in discovery
endpoint. Thanks to that, core resources singular name always have
higher precedence than CRDs shortcuts or singular names.

Kubernetes-commit: 0990ba1cc92449bbbd9b25a4391f1da834f8c5fd
2022-11-02 12:53:56 +03:00
kkkkun aec915f887 Fix CONNECT requests from others requests
Signed-off-by: kkkkun <scuzk373x@gmail.com>

Kubernetes-commit: 973f7c49b887b00c43874ad1085237632efcc300
2022-12-22 11:52:18 +08:00
Wojciech Tyczyński 8808b718c9 Explicit sorting in TestList storage test
Kubernetes-commit: 34de5fa73dabd9dcbd6f535cf6a853371ec653f1
2022-11-21 12:03:54 +01:00
Wojciech Tyczyński 299c158ba3 Reuse generic List test for watchcache
Kubernetes-commit: ef8c4fbca8e5bed1e7edc162b95c412a7f1a758e
2022-11-04 22:01:37 +01:00
Wojciech Tyczyński 012ace9f52 Fix lack of sorting of list results in watchcache
Kubernetes-commit: aaaee155dd3c9402e674d066f4d6ca30cc971c8e
2022-11-08 13:06:56 +01:00
Wojciech Tyczyński 8cd19efa73 Fix inconsistency in returning list results both in etcd3 and watchcache
Kubernetes-commit: da8d197a7205c01fdf376246995b0a1b3ab53859
2022-11-08 11:47:28 +01:00
Jordan Liggitt c6b4e07ee4 Fix indentation/spacing in comments to render correctly in godoc
Kubernetes-commit: 78cb3862f11225135afdf76f3424e2d7b33104c7
2022-12-17 17:31:05 -05:00
Abu Kashem c44ad6bb02 apiserver: refactor cors filter
Kubernetes-commit: ea251b5605c22d82962d4e699d933428e4c9c211
2022-11-03 09:29:47 -04:00
Abu Kashem 5b1e3f38d8 apiserver: refactor cors unit test
Kubernetes-commit: ae7327ab8eb2e05c3ccb185354eed247795bbc6d
2022-11-03 09:05:40 -04:00
Daniel Smith d053de6ca3 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

Kubernetes-commit: 8100efc7b3122ad119ee8fa4bbbedef3b90f2e0d
2022-11-18 00:12:50 +00:00
Antoine Pelisse 76a233ebec Allow profiling information to be served on Unix-Domain Socket
Serving profiling information can leak information or expose the
apiserver to possible DoS attacks. Serving on a UDS is more secure
though slightly less convenient. One can't use `go tool pprof` directly
against the socket since it's not supported, but can either run a proxy
to copy from the socket over to http, or use `curl --unix-socket` to
download the profile and then use `go tool pprof`.

Kubernetes-commit: 667599b0ddfad8ba760d3bbfe006aae0d8f7dec6
2022-11-29 11:07:15 -08:00
qingwave f56a6a65d1 add help for cel metrics
Signed-off-by: qingwave <isguory@gmail.com>

Kubernetes-commit: 90357e62d200a9eb77aa0534298de46f0ae364a4
2022-12-09 04:53:02 +00:00
Rita Zhang 911df25617 Update the godoc on the encryption config API on how to specify group/resources to be encrypted
Signed-off-by: Rita Zhang <rita.z.zhang@gmail.com>

Kubernetes-commit: c085031a8f3f366708f9b7aa7ab1695d802d9f5a
2022-11-28 07:18:02 -08:00
Antoine Pelisse 77591ad906 Fix FakeObjectCreater ignoring given gvk
Kubernetes-commit: 948ab9175a8151af44fb958c6511c6d756c983be
2022-12-08 09:24:14 -08:00
Antoine Pelisse 4b7edb49fe fieldmanager: Move TestFieldManager into its own package
Kubernetes-commit: bdbc0eb2088f8d342a281c4f05295bf11861ef1f
2022-12-01 09:32:43 -08:00
Antoine Pelisse 79880fd996 fieldmanager: Make all tests external
Kubernetes-commit: 56cac6465588467d7df39c87930d94a9dc5bc299
2022-11-30 13:53:31 -08:00
Antoine Pelisse 5bc84857f2 fieldmanager: Move private setLastApplied to internal.SetLastApplied
Since this is used both in real-code and in test-code, let's put it
somewhere it can be re-used.

Kubernetes-commit: 9c447177e85dadaba0f12fa95c5d8ee6c4e54602
2022-11-30 13:07:33 -08:00
Antoine Pelisse 4a0d0a943f fieldmanager: remove dependencies on dummy version conversion for tests
Kubernetes-commit: 530d25026e06d0253a6c663d4dde2e35040e82da
2022-11-30 12:53:18 -08:00
Antoine Pelisse 672009bfe3 fieldmanager: Remove unnecessary method for creating TestFieldManager
Kubernetes-commit: 7217e0308dbf1743327345916c6945fb947e8958
2022-11-29 20:37:53 -08:00
Dario Tranchitella 0477735c3a fix(docs): wrong comment block for ResolveEndpoint function
Kubernetes-commit: 01c7559856f6c81d0deb7d042c06bee15be65527
2022-09-06 14:38:30 +02:00
kkkkun fc3eec104b Cleanup reportedVerb only from
Kubernetes-commit: 42f72a3fe9dc27c0b0f10fd7dc4ab4cb6f901314
2022-08-14 13:53:25 +08:00
Alexander Zielenski 4a90b2a1b2 add alexzielenski to OWNERS
Kubernetes-commit: 10b9a1fe196b082c1702ad880cd2f9756ce17a87
2022-11-15 08:43:25 -08:00
Antoine Pelisse dd4640ce38 Add apelisse into some more OWNERS files
Kubernetes-commit: b5f2130f240b0a9ebd1d0edd400b899d0efb8b2b
2022-11-14 16:28:14 -08:00