Commit Graph

25 Commits

Author SHA1 Message Date
Mskxn 2595ae0416 use stopCh to avoid goroutine leak in tests
Kubernetes-commit: 132d477cb7aa323c0eae6dd9a09f9c93fb570b83
2023-07-06 16:24:58 +08:00
Tim Hockin 0165503c5a Replace uses of ObjectReflectDiff with cmp.Diff
ObjectReflectDiff is already a shim over cmp.Diff, so no actual output
or behavior changes

Kubernetes-commit: bc302fa4144d21a338683cd83701661f97be4aba
2023-03-23 11:34:03 -07:00
Cici Huang 9f6b13b337 Update admission initializers.
Moved RestMapper and add DynamicClient

Kubernetes-commit: c8a089de4692ef94ec25fc5874906640d0ec9a28
2022-11-07 21:24:46 +00:00
Wojciech Tyczyński 5ab2c69c4c Fix ResourceQuota admission shutdown
Kubernetes-commit: f8211d7e447cc6c29139ebf3422f0752278d6da1
2022-05-18 19:30:23 +02:00
wojtekt b898581360 Migrate to k8s.io/utils/clock in apiserver
Kubernetes-commit: 859a98c0358610e2c127cd2fba1be601ca975188
2021-09-14 20:36:07 +02:00
David Eads 331894196f add featuregate inspection as admission plugin initializer
Kubernetes-commit: 675c2fb924e82091f7ce4601e48daf4cc7030e72
2019-11-05 14:28:40 -05:00
Clayton Coleman 3d42d38e70 namespace: Provide a special status cause when a namespace is terminating
Clients should be able to identify when a namespace is being terminated and
take special action such as backing off or giving up. Add a helper for
getting the cause of an error and then add a special cause to the forbidden
error that namespace lifecycle admission returns. We can't change the forbidden
reason without potentially breaking older clients and so cause is the
appropriate tool.

Add `StatusCause` and `HasStatusCause` to the errors package to make checking
for causes simpler. Add `NamespaceTerminatingCause` to the v1 API as a constant.

Kubernetes-commit: a62c5b282fda7c0832d329cde45e5e0a836924e8
2019-10-19 22:57:21 -04:00
Jordan Liggitt 0c706a033c Plumb context to admission Admit/Validate
Kubernetes-commit: 61774cd7176cae0c0324d23ab20e6c6b3038153f
2019-08-19 10:48:08 -04:00
Joe Betz f384b59525 Update tests for: Pass {Operation}Option to Webhooks
Kubernetes-commit: 900d652a9ac11e53293950b3d191295c21430215
2019-05-07 13:37:07 -07:00
Mehdy Bohlool 0fbb46dc25 Remove the propagated scheme from the Admission chain
Kubernetes-commit: cebb4ee2ac9e19fe90f78c3285978e585e67a3ac
2019-02-16 13:28:14 -08:00
Mehdy Bohlool 792921debf Mechanical changes due to signature change for Admit and Validate functions
Kubernetes-commit: d08bc3774dfd93ba9fa389062900a5ffb25768d6
2019-02-16 00:44:29 -08:00
jennybuckley 91278157f6 Support dry run in admission plugins
Kubernetes-commit: adafb1365e2b9f6c422c437e916e22a4fe1c2e3a
2018-08-06 10:37:44 -07:00
hzxuzhonghu c37db061da remove redundant code in admission initializer
Kubernetes-commit: 9d1e6d3e2cc25db8e07db446d00390059c8264f8
2017-11-08 10:54:06 +08:00
Dr. Stefan Schimanski 45afa13373 admission: rename Validate{ -> Initialization}, Validat{ingAdmit -> e}
Kubernetes-commit: aedcf681b32618be3cf9ad40eeb039f1bb26c5ae
2017-10-27 17:09:39 +02:00
Dr. Stefan Schimanski 3eeded3a29 admission: wire create+update validation func into kube registries
Kubernetes-commit: 2452afffe09e1ced9487e5a701beb1443a92b741
2017-10-24 15:33:28 +02:00
David Eads 3cb246ace6 move webhook admission to generic apiserver
Kubernetes-commit: 8c1fe1f61a1de754a2cfed1966f4a1f8024ca618
2017-10-24 08:48:05 -04:00
David Eads d3f753a815 update admission webhook to accept client config
Kubernetes-commit: 0859798e8e278ec382dcbeb77914f40bf2c78a2c
2017-10-18 12:57:59 -04:00
p0lyn0mial 136304ddb2 removes k8s.io/kubernetes/pkg/api dependency from the webhook plugin.
Kubernetes-commit: fa96700b76de3df759b3dddb747da575c909acec
2017-10-09 22:15:25 +02:00
p0lyn0mial 941c87ca76 moved admission interfaces WantsClientCert, WantsAuthorizer and WantsExternalKubeClientSet to apiserver
Kubernetes-commit: 475493ced69f47dd78d72ff98bf2c5853fc5ea19
2017-09-27 22:05:34 +02:00
Cao Shufeng 157dcc8988 fix NamespaceLifecycle admission
forceLiveLookupCache is designed to save recently deleted namespaces.
But currently, cluster scoped resources are also put into it.
For example, when we run:
kubectl delete clusterrole edit
The "edit" is put into forceLiveLookupCache as a deleted namespace.
This change fix the invalid action.

Kubernetes-commit: a8693b63b910d02397eb4a27873cd7da08242a14
2017-07-28 13:56:11 +00:00
Jordan Liggitt 4c5bbed295 Never prevent deletion of resources as part of namespace lifecycle
Kubernetes-commit: 95bf4983dec5909c536d6d602b4cf7a9b5c78c99
2017-07-19 03:49:08 +00:00
Chao Xu 8be42ee0d0 run hack/update-all
Kubernetes-commit: 60604f8818aecbc9c3736fbc32747cc0a535bc80
2017-06-28 00:14:31 +00:00
Chao Xu 81b7aaaa7d run root-rewrite-import-client-go-api-types
Kubernetes-commit: f2d3220a11111f86b2f481e70e3c1ca4f5896f44
2017-06-28 00:14:31 +00:00
p0lyn0mial 42d367c84c register all generic admission plugins when AdmissionOptions are created.
lifecycle plugin: make use of the libraries under k8s.io/client-go/pkg/api and k8s.io/client-go/kubernetes
for the client libraries instead of k8s.io/kubernetes/client/*

move registration to AdmissionOptions

Kubernetes-commit: 77eb2f39500f1fcf66899ea557791e7bca851449
2017-06-13 20:47:29 +00:00
p0lyn0mial d3a026ac63 move namespace lifecycle plugin to apiserver
Kubernetes-commit: 1a5da9afc804eed6630caa1a17540d1a171b211a
2017-06-13 20:47:29 +00:00