Commit Graph

102 Commits

Author SHA1 Message Date
Tim Allclair
7537cec567
Fix MatchConditions webhook validation testing (#116784)
* Fix MatchConditions webhook validation testing

* #squash verify error type

* #squash fix duplicate registration

* #squash uncomment validation test
2023-03-21 21:38:35 -07:00
Igor Velichkovich
5e5b3029f3
Matchconditions admission webhooks alpha implementation for kep-3716 (#116261)
* api changes adding match conditions

* feature gate and registry strategy to drop fields

* matchConditions logic for admission webhooks

* feedback

* update test

* import order

* bears.com

* update fail policy ignore behavior

* update docs and matcher to hold fail policy as non-pointer

* update matcher error aggregation, fix early fail failpolicy ignore, update docs

* final cleanup

* openapi gen
2023-03-14 20:28:26 -07:00
Jiahui Feng
54283a1d38 exempt validatingadmissionpolicies/status
because admission control object does not apply to themselves.
2023-03-07 15:48:21 -08:00
Kubernetes Prow Robot
e8ae6658ed
Merge pull request #115065 from apelisse/apimachinery-managed-fields
managedfields: Move most of fieldmanager package to managefields
2023-03-09 21:34:22 -08:00
Maksim Nabokikh
c1431af4f8
KEP-3325: Promote SelfSubjectReview to Beta (#116274)
* Promote SelfSubjectReview to Beta

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Fix whoami API

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Fixes according to code review

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

---------

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2023-03-08 15:42:33 -08:00
Antoine Pelisse
4f3859ce91 managedfields: Move most of fieldmanager package to managefields 2023-03-08 13:44:00 -08:00
Antoine Pelisse
adfc65ec23 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.
2023-01-09 10:10:17 -08:00
Cici Huang
e7d83a1fb7 Integrate cel admission with API.
Co-authored-by: Alexander Zielenski <zielenski@google.com>
Co-authored-by: Joe Betz <jpbetz@google.com>
2022-11-07 21:38:55 +00:00
m.nabokikh
00dfba473b Add auth API to get self subject attributes
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2022-09-14 18:00:26 +02:00
Kubernetes Prow Robot
cf2800b812
Merge pull request #111402 from verb/111030-ec-ga
Promote EphemeralContainers feature to GA
2022-07-29 19:29:20 -07: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
Lee Verberne
d238e67ba6 Remove EphemeralContainers feature-gate checks 2022-07-26 02:55:30 +02:00
Abirdcfly
00b9ead02c cleanup: remove duplicate import
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2022-07-14 11:25:19 +08:00
ahrtr
fe95aa614c io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os 2022-02-03 05:32:12 +08:00
Jordan Liggitt
2979c3325e Switch to go.etcd.io/etcd/client/v3 2021-06-15 09:53:06 -04:00
Kevin Wiesmueller
96a8df455c fix TestMutatingWebhookResetsInvalidManagedFields flakes 2021-04-23 00:09:31 +02:00
Shihang Zhang
925900317e allow multiple of --service-account-issuer 2021-04-19 09:54:11 -07:00
Jordan Liggitt
33ad842480 allow evictions subresource to accept policy/v1 and policy/v1beta1 2021-04-13 21:22:25 -04:00
Kubernetes Prow Robot
c2ff2910fd
Merge pull request #98797 from sxllwx/fix/issue98606
(integration) adjust the test's client-side detection of a successful timeout case to include the connection reset
2021-03-10 12:28:22 -08:00
Kubernetes Prow Robot
4cf8823fba
Merge pull request #98074 from kwiesmueller/admission-reset-managedFields
Reset managedFields corrupted by admission controllers
2021-03-06 21:15:42 -08:00
David Eads
f3597cbf2a clean usage of admissionregistration/v1beta1 from tests 2021-03-03 17:39:31 -05:00
David Eads
a473ef6c0a use direct etcd creation to verify migrated v1beta1 admissionwebhooks 2021-03-03 17:33:27 -05:00
scott
d258e005e8 add client-side detection of a successful timeout case to include the connection reset 2021-03-03 10:15:57 +08:00
Kevin Wiesmueller
98d498117b only use managedFields decoding for admission check 2021-03-01 20:29:15 +01:00
Kevin Wiesmueller
ba2f6104f6 add warning check to managedFields integration test 2021-03-01 19:59:59 +01:00
Kevin Wiesmueller
711f2dab47 fix test 2021-03-01 19:59:58 +01:00
Kevin Wiesmueller
ffbae9c5b4 disable webhook for testing 2021-03-01 19:59:55 +01:00
Kevin Wiesmueller
f18d21d6eb test managedFields admission validation 2021-03-01 19:59:06 +01:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Abu Kashem
e416c9e574
apiserver: plumb context with request deadline
- as soon as a request is received by the apiserver, determine the
  timeout of the request and set a new request context with the deadline.
- the timeout filter that times out non-long-running requests should
  use the request context as opposed to a fixed 60s wait today.
- admission and storage layer uses the same request context with the
  deadline specified.

we use the default timeout enforced by the apiserver:
- if the user has specified a timeout of 0s, this implies no timeout on the user's part.
- if the user has specified a timeout that exceeds the maximum deadline allowed by the apiserver.
2021-01-28 14:15:04 -05:00
Jordan Liggitt
afd92b3b3e Revert "plumb context with request deadline"
This reverts commit 83f869ee13.
2020-11-19 18:15:04 -05:00
Haowei Cai
40a65577c7 generated 2020-11-18 12:48:26 -08:00
Haowei Cai
8bcf34a203 unit and integration tests
apiserver dedups and adds warning in CREATE/UPDATE/PATCH requests;
also handles duplication caused by mutating admission.
2020-11-18 12:46:20 -08:00
Abu Kashem
83f869ee13
plumb context with request deadline
- as soon as a request is received by the apiserver, determine the
timeout of the request and set a new request context with the deadline.
- the timeout filter that times out non-long-running requests should
use the request context as opposed to a fixed 60s wait today.
- admission and storage layer uses the same request context with the
deadline specified.
2020-11-14 11:54:17 -05:00
Kubernetes Prow Robot
5549a0d9bb
Merge pull request #95012 from nodo/add-namespace-to-post-based-namespace-creation
Make the creation of namespace using POST and PATCH consistent
2020-10-01 17:37:20 -07:00
Andrea Nodari
3cb510e33e Make the creation of namespace using POST and PATCH consistent
PATCH verb is used when creating a namespace using server-side apply,
while POST verb is used when creating a namespace using client-side
apply.

The difference in path between the two ways to create a namespace led to
an inconsistency when calling webhooks. When server-side apply is used,
the request sent to webhooks has the field "namespace" populated with
the name of namespace being created. On the other hand, when using
client-side apply the "namespace" field is omitted.

This commit aims to make the behaviour consistent and populates the
"namespace" field when creating a namespace using POST verb (i.e.
client-side apply).
2020-10-01 18:05:49 +02:00
Lee Verberne
bf0a33d1de Use EphemeralContainers for storage validation
When updating ephemeral containers, convert Pod to EphemeralContainers
in storage validation. This resolves a bug where admission webhook
validation fails for ephemeral container updates because the webhook
client cannot perform the conversion.

Also enable the EphemeralContainers feature gate for the admission
control integration test, which would have caught this bug.
2020-09-10 17:24:52 +02:00
Kubernetes Prow Robot
c143ea4bbf
Merge pull request #90522 from beautytiger/fix/nilranger
cleanup: no need nil check before range
2020-08-27 17:54:31 -07:00
Jordan Liggitt
dcc536097a Deflake timeout admission test 2020-07-07 13:36:07 -04:00
Jordan Liggitt
5eef60a00a Add warnings capability for admission webhooks 2020-07-01 12:14:06 -04:00
Guangming Wang
e92a91eb72 cleanup: no need nil check before range 2020-04-27 22:12:12 +08:00
Jordan Liggitt
b7c2faf26c client-go dynamic client: add context to callers 2020-03-06 10:56:23 -05:00
Jordan Liggitt
b19dc3a474 client-go dynamic client: update DeleteOptions callers 2020-03-06 10:21:23 -05:00
Mike Danese
76f8594378 more artisanal fixes
Most of these could have been refactored automatically but it wouldn't
have been uglier. The unsophisticated tooling left lots of unnecessary
struct -> pointer -> struct transitions.
2020-03-05 14:59:47 -08:00
Mike Danese
c58e69ec79 automated refactor 2020-03-05 14:59:46 -08:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Mike Danese
d55d6175f8 refactor 2020-01-29 08:50:45 -08:00
danielqsj
6596a14d39 add missing alias of api errors under test 2019-12-26 17:29:38 +08:00
Jordan Liggitt
18ba6f9482 Remove references to unserved types 2019-12-13 12:21:33 -05:00