Commit Graph

2757 Commits (8060d565946848abe4f67ffffb810dd3505fe4cb)

Author SHA1 Message Date
Mike Danese e5227216c0 rebase authenticators onto new interface. 2018-10-22 10:16:59 -07:00
Slava Semushin 14c969b604 Remove myself from OWNERS files. 2018-10-16 22:47:44 +01:00
k8s-ci-robot a1d1385f40
Merge pull request #66854 from k82cn/k8s_66853
Set PriorityClassName when there's a default PirorityClass.
2018-10-13 01:33:02 -07:00
tanshanshan b7c7966b9f Move pkg/scheduler/algorithm/well_known_labels.go out 2018-10-13 09:10:00 +08:00
k8s-ci-robot 53e85280f4
Merge pull request #69714 from ericchiang/owners
Remove ericchiang from OWNERS files
2018-10-12 16:01:52 -07:00
k8s-ci-robot e23a3af013
Merge pull request #67802 from krmayankk/dockershimtests
Implement RunAsGroup Strategy in PSP
2018-10-12 11:19:39 -07:00
k8s-ci-robot b3033a7278
Merge pull request #67934 from tanshanshan/typo828
fix spelling mistakes
2018-10-11 18:26:24 -07:00
Eric Chiang 766f5875bf Remove ericchiang from OWNERS files
Kept myself in the OpenID Connect ones for now.
2018-10-11 18:11:15 -07:00
Mayank Kumar bc3e3afc46 api changes for psp runasgroup policy 2018-10-09 17:32:09 -07:00
k8s-ci-robot 0f17e9ade6
Merge pull request #69386 from cblecker/go-1.11
Update to go1.11.1
2018-10-05 17:35:51 -07:00
Christoph Blecker 563734faf7
fix vet error in plugin/pkg/admission/storage/persistentvolume/label/admission.go
plugin/pkg/admission/storage/persistentvolume/label/admission.go:173: Verbose.Info call has possible formatting directive %v
2018-10-05 15:54:23 -07:00
Christoph Blecker 97b2992dc1
Update gofmt for go1.11 2018-10-05 12:59:38 -07:00
Walter Fender f3f46d5f5a Moving the cloudprovider interface to staging.
Individual implementations are not yet being moved.
Fixed all dependencies which call the interface.
Fixed golint exceptions to reflect the move.
Added project info as per @dims and
https://github.com/kubernetes/kubernetes-template-project.
Added dims to the security contacts.
Fixed minor issues.
Added missing template files.
Copied ControllerClientBuilder interface to cp.
This allows us to break the only dependency on K8s/K8s.
Added TODO to ControllerClientBuilder.
Fixed GoDeps.
Factored in feedback from JustinSB.
2018-10-04 14:41:20 -07:00
k8s-ci-robot f14271b27d
Merge pull request #69133 from yue9944882/refactor/externalize-namespace-admission-controller
Externalize namespace admission controller
2018-10-03 04:43:49 -07:00
k8s-ci-robot c179a9c9df
Merge pull request #67356 from yliaog/master
Moved staging/src/k8s.io/client-go/tools/bootstrap to staging/src/k8s…
2018-10-02 20:35:51 -07:00
k8s-ci-robot 7bcdd8b55c
Merge pull request #62673 from jennybuckley/no-limitrange-on-pod-updates
Do not run limitrange admission plugin on pod update requests
2018-10-02 12:13:34 -07:00
Yu Liao fc21115c3f Moved staging/src/k8s.io/client-go/tools/bootstrap to staging/src/k8s.io/cluster-bootstrap 2018-10-02 09:46:13 -07:00
k8s-ci-robot 8e6172dec2
Merge pull request #69062 from dghubble/add-configmap-get
Add configmap get to system:kube-controller-manager
2018-09-27 07:18:50 -07:00
Da K. Ma 083b92acf3 Set PriorityClassName when there's a default PirorityClass.
Signed-off-by: Da K. Ma <klaus1982.cn@gmail.com>
2018-09-27 15:26:13 +08:00
zuoxiu.jm a097e23efc namespace exists externalization 2018-09-27 13:24:15 +08:00
zuoxiu.jm be7194e166 namespace autoprovision externalization 2018-09-27 12:11:02 +08:00
Dalton Hubble dfc3c83e64 Add configmap get to system:kube-controller-manager
* v1.12.x kube-controller-manager tries to get the
extension-apiserver-authentication ConfigMap by default
2018-09-26 22:03:27 +02:00
k8s-ci-robot 07e81cb8ff
Merge pull request #67831 from xmudrii/extern-exec
admission/exec: externalize exec admission controller
2018-09-26 09:55:05 -07:00
k8s-ci-robot 2042125a51
Merge pull request #67810 from yue9944882/refactor/externalize-podpreset
Propagate externalization to podpreset admission controller
2018-09-26 08:44:17 -07:00
k8s-ci-robot 055a816b2f
Merge pull request #67696 from yue9944882/chore/cleanup-limit-ranger-admission
Propagate externalization to limitranger admission controller
2018-09-26 07:24:11 -07:00
k8s-ci-robot a67689dfca
Merge pull request #68245 from jingyih/remove_tagName_in_goDoc
*: Remove comment tags in GoDoc
2018-09-25 06:13:23 -07:00
k8s-ci-robot 0805860dba
Merge pull request #67870 from yue9944882/refactor/externalize-resource-quota-admission-controller
Externalize resource quota admission controller & controller reconciliation
2018-09-25 02:41:40 -07:00
k8s-ci-robot 38d2f05d52
Merge pull request #67842 from xmudrii/extern-priority
admission/priority: externalize priority admission controller
2018-09-25 01:27:31 -07:00
jennybuckley 3f1b0cc511 Don't run limitranger admission plugin on pod update requests 2018-09-18 14:49:45 -07:00
Jingyi Hu 61117761cd *: Remove comment tags in GoDoc
Adding blank line between comment tag and package name in doc.go. So
that the comment tags such as '+k8s:deepcopy-gen=package' do not show up
in GoDoc.
2018-09-13 20:27:32 -07:00
Cheng Xing 4ca39ef0ed Consolidated CSIDriver logic under CSIDriverRegistry flag 2018-09-10 13:34:40 -07:00
Cheng Xing 94d649b590 Rearranged feature flags 2018-09-07 17:45:27 -07:00
Cheng Xing becc6a9c19 Implemented logic in kubelet for registering node info, including wiring to CSINodeInfo; added unit tests for node updates; updated RBAC, NodeAuthorizer, NodeRestriction. 2018-09-06 19:16:51 -07:00
Jan Safranek dc6be0cbf1 Add new RBAC rules for CSIDriver
Nodes need to watch CSIDrivers to know if they should send pod information
in NodePublish.
2018-09-05 21:01:32 -04:00
Kubernetes Submit Queue 19c2538798
Merge pull request #67955 from jsafrane/csi-skip-attach-saad
Automatic merge from submit-queue (batch tested with PRs 68161, 68023, 67909, 67955, 67731). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

CSI: skip attach for non-attachable drivers

**What this PR does / why we need it**:
This is implementation of https://github.com/kubernetes/community/pull/2523. CSI volumes that don't need attach/detach now don't need external attacher running.

WIP:
 * contains #67803 to get CSIDriver API. Ignore the first commit.
 * ~~missing e2e test~~

/sig storage

cc: @saad-ali @vladimirvivien @verult @msau42 @gnufied @davidz627 

**Release note**:
```release-note
CSI volume plugin does not need external attacher for non-attachable CSI volumes.
```
2018-09-05 14:51:51 -07:00
Kubernetes Submit Queue d7c849969d
Merge pull request #68134 from yue9944882/chore/add-yue9944882-reviewer
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Add yue9944882 as subproject reviewer (core admission/apiserver)

extend reviewer bandwidth 😃am a super careful reviewer

i had contributed series of refactors for core admission controllers and apiserver launch flow. 

/assign @deads2k 

**Release note**:

```release-note
NONE
```
2018-09-05 10:55:18 -07:00
Jan Safranek 4e7eca7b31 Add new RBAC rules for CSIDriver
A/D controller and nodes need to watch CSIDrivers to know if they should send pod information
in NodePublish.
2018-09-05 10:15:43 -04:00
Janet Kuo 5186807587 Add TTL GC controller 2018-09-04 13:11:18 -07:00
Tim Allclair 0c59d4db32 Add RuntimeClass read permission for nodes 2018-08-31 18:22:13 -07:00
Marko Mudrinić 21d2377821
admission/priority: externalize priority admission controller 2018-08-31 15:33:37 +02:00
yue9944882 099f9a8ba2 add reviewer 2018-08-31 20:29:09 +08:00
Kubernetes Submit Queue c081c024c7
Merge pull request #67349 from mikedanese/trbeta
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

promote TokenRequest and projection to beta in 1.12

```release-note
TokenRequest and TokenRequestProjection are now beta features. To enable these feature, the API server needs to be started with the following flags:
* --service-account-issuer
* --service-account-signing-key-file
* --service-account-api-audiences
```
2018-08-30 20:09:42 -07:00
lichuqiang 4c43d626f2 related test update 2018-08-29 10:30:16 +08:00
lichuqiang b4a57f6855 combine feature gate VolumeScheduling and DynamicProvisioningScheduling into one 2018-08-29 10:30:08 +08:00
tanshanshan a83c4dbd19 fix spelling mistakes 2018-08-28 17:12:36 +08:00
Kubernetes Submit Queue 583dd0ff6b
Merge pull request #64597 from wteiken/add_review_annotations2
Automatic merge from submit-queue (batch tested with PRs 64597, 67854, 67734, 67917, 67688). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Allow ImageReview backend to add audit annotations.

**What this PR does / why we need it**: 
This can be used to create annotations that will allow auditing of the created 
pods.

The change also introduces "fail open" audit annotations in addition to the
previously existing pod annotation for fail open.  The pod annotations for 
fail open will be deprecated soon.


**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:
```release-note
Allow ImageReview backend to return annotations to be added to the created pod.
```
2018-08-27 22:18:06 -07:00
yue9944882 48dd084a79 externalize fields for quota private schema 2018-08-27 21:47:28 +08:00
yue9944882 b86e8f7631 externalize quota admission controller 2018-08-27 21:47:10 +08:00
Marko Mudrinić b622acf8ec
admission/exec: externalize exec admission controller 2018-08-27 11:37:15 +02:00
Michael Taufen 1b7d06e025 Kubelet creates and manages node leases
This extends the Kubelet to create and periodically update leases in a
new kube-node-lease namespace. Based on [KEP-0009](https://github.com/kubernetes/community/blob/master/keps/sig-node/0009-node-heartbeat.md),
these leases can be used as a node health signal, and will allow us to
reduce the load caused by over-frequent node status reporting.

- add NodeLease feature gate
- add kube-node-lease system namespace for node leases
- add Kubelet option for lease duration
- add Kubelet-internal lease controller to create and update lease
- add e2e test for NodeLease feature
- modify node authorizer and node restriction admission controller
to allow Kubelets access to corresponding leases
2018-08-26 16:03:36 -07:00
yue9944882 1b3571b425 externalize podpreset 2018-08-24 17:25:02 +08:00
yue9944882 61ba80cbac externalize limitrange 2018-08-24 13:13:19 +08:00
Wilfried Teiken 73c522f79c Allow ImageReview backend to add audit annotations.
This can be used to create annotations that will allow auditing of the created
pods.

The change also introduces "fail open" audit annotations in addition to the
previously existing pod annotation for fail open.  The pod annotations for
fail open will be deprecated soon.
2018-08-23 22:53:06 -04:00
Kubernetes Submit Queue 687553a47a
Merge pull request #67576 from yue9944882/externalize-secret-serviceaccount-informer
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Externalize serviceaacount admission controller

ref: #66680

this pull externalizes serviceaccount admission controller in which secret & serviceaccount informers will be completely replaced.

/sig api-machinery

**Release note**:

```release-note
NONE
```
2018-08-22 19:19:07 -07:00
yue9944882 8dd3919d12 externalize storageclass 2018-08-22 21:04:28 +08:00
yue9944882 17306b540b externalize serviceaacount admission controller
remove unused internal serviceaccount util
2018-08-22 11:41:54 +08:00
yue9944882 f624a4efb8 externalize node admission
fixes internal pod annotation reference

completely strip internal informers from authz initialization
2018-08-21 23:33:03 +08:00
yue9944882 e7d0983707 externalize pv informer in node authorizer 2018-08-17 11:14:43 +08:00
yue9944882 3e205cadcc externalize storage object in use protection
prune listers from admission controller
2018-08-17 11:14:39 +08:00
yue9944882 715f04b2ed should cast va instead of pv 2018-08-16 11:15:08 +08:00
Kubernetes Submit Queue 76434bd62a
Merge pull request #66780 from NetApp/volumeresize
Automatic merge from submit-queue (batch tested with PRs 66780, 67330). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Changed admission controller to allow volume expansion for all volume plugins

**What this PR does / why we need it**:
There are two motivations for this change:

1. CSI plugins are soon going to support volume expansion. For such plugins, admission controller doesn't know whether the plugins are capabale of supporting volume expansion or not.
2. Currently, admission controller rejects PVC updates for in-tree plugins that don't support volume expansion (e.g., NFS, iSCSI). This change allows external controllers to expand volumes similar to how external provisioners are accommodated.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
This PR mimics the behavior of the PV controller when PVs are provisioned externally by logging and setting a new event for PVs that are being expanded externally. As SIG Storage is planning new types of operations on PVs, it may make more sense to a have a single event for all actions taken by external controllers.

**Release note**:

```release-note
The check for unsupported plugins during volume resize has been moved from the admission controller to the two controllers that handle volume resize.
```
/sig storage
/assign @gnufied @jsafrane @wongma7
2018-08-14 12:22:00 -07:00
Mike Danese 92b4e3ca60 promote TokenRequest and projection to beta in 1.12 2018-08-13 13:01:43 -07:00
Kubernetes Submit Queue 524a81496b
Merge pull request #66866 from kgolab/kg-quota-refactor
Automatic merge from submit-queue (batch tested with PRs 67160, 67090, 67159, 66866, 62111). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Refactor checkRequest to allow it to be called from outside

**What this PR does / why we need it**:

Refactor checkRequest method to allow it to be called from outside of admission controller (most of its body does not depend on any quotaEvaluator properties).

```release-note
NONE
```
2018-08-09 15:11:07 -07:00
Kubernetes Submit Queue 44d6de79e7
Merge pull request #67116 from yue9944882/refactor/node-admission-controller-externalize
Automatic merge from submit-queue (batch tested with PRs 65297, 67179, 67116, 67011, 66842). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Externalize node admission controller

**Release note**:

```release-note
NONE
```



**What this PR does / why we need it**:

/sig api-machinery

under unbrella: #66680

We start with injecting external informer/lister into node admission controller for that it's slightly simpler than the others.

Here is the thing I actually did in this pull:

1. Enable plugin initializer to inject external/internal clientset/informers into the admission controllers.
2. Receive external informer in node admission controller.
3. Create a `AdmissionConfig` following how we did in `AuthenticationConfig` and `AuthorizationConfig` and creates the actual plugin initializers and the admission post-start hook in its `New()` method
2018-08-09 08:39:31 -07:00
yue9944882 bc1fb1f7e8 node authz/ad externalization 2018-08-09 10:57:30 +08:00
Chao Xu d89c8dd8c0 generated 2018-08-06 18:59:53 -07:00
Chao Xu 355691d310 Remove rest.ConnectRequest.
Make apiserver pass connectRequest.Options directly to the admission layer. All
the information in rest.ConnectRequest is present in admission attributes.
2018-08-06 18:59:52 -07:00
jennybuckley adafb1365e Support dry run in admission plugins 2018-08-06 10:37:44 -07:00
Kubernetes Submit Queue d4d0276234
Merge pull request #66156 from vikaschoudhary16/quota-api-v1beta1
Automatic merge from submit-queue (batch tested with PRs 66351, 66883, 66156). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Graduate Quota configuration API to v1beta1

ref: kubernetes/features#587


**Release note**:

```release-note
Quota admission configuration api graduated to v1beta1
```
/sig node
/sig scheduling
/cc @derekwaynecarr @deads2k @liggitt @sjenning @aveshagarwal @ravisantoshgudimetla @smarterclayton
2018-08-06 07:13:21 -07:00
Kubernetes Submit Queue 14bcbb9450
Merge pull request #66553 from feiskyer/azure-disk-availablity-zone
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add availability zones support to Azure managed disks

**What this PR does / why we need it**:

Continue of [Azure Availability Zone feature](https://github.com/kubernetes/features/issues/586).

This PR adds availability zone support for Azure managed disks and its storage class. Zoned managed disks is enabled by default if there are zoned nodes in the cluster.

The zone could also be customized by `zone` or `zones` parameter, e.g.

```yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
  name: managed-disk-zone-1
parameters:
  zone: "southeastasia-1"
  # zones: "southeastasia-1,"southeastasia-2"
  cachingmode: None
  kind: Managed
  storageaccounttype: Standard_LRS
provisioner: kubernetes.io/azure-disk
reclaimPolicy: Delete
volumeBindingMode: Immediate
```

All zoned AzureDisk PV will also be labeled with its availability zone, e.g.

```sh
$ kubectl get pvc pvc-azuredisk-az-1
NAME                 STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS          AGE
pvc-azuredisk-az-1   Bound     pvc-5ad0c7b8-8f0b-11e8-94f2-000d3a07de8c   5Gi        RWO            managed-disk-zone-1   2h

$ kubectl get pv pvc-5ad0c7b8-8f0b-11e8-94f2-000d3a07de8c --show-labels
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS    CLAIM                        STORAGECLASS          REASON    AGE       LABELS
pvc-5ad0c7b8-8f0b-11e8-94f2-000d3a07de8c   5Gi        RWO            Delete           Bound     default/pvc-azuredisk-az-1   managed-disk-zone-1             2h        failure-domain.beta.kubernetes.io/region=southeastasia,failure-domain.beta.kubernetes.io/zone=southeastasia-1
```

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

See also the [KEP](https://github.com/kubernetes/community/pull/2364).

DynamicProvisioningScheduling feature would be added in a following PR.

**Release note**:

```release-note
Azure managed disks now support availability zones and new parameters `zoned`, `zone` and `zones` are added for AzureDisk storage class.
```

/kind feature
/sig azure
/assign @brendandburns @khenidak @andyzhangx
2018-08-06 02:02:54 -07:00
vikaschoudhary16 5e384d43f8 Update api version references 2018-08-03 11:07:55 -04:00
vikaschoudhary16 1708ee4184 Graduate quota configuration api to v1beta1 2018-08-03 02:09:25 -04:00
Kubernetes Submit Queue f5772e3d75
Merge pull request #62901 from hzxuzhonghu/eventratelimit-aggregate-errors
Automatic merge from submit-queue (batch tested with PRs 62901, 66562, 66938, 66927, 66926). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Eventratelimit aggregates all reject errors

Previously, Eventratelimit validates event by each limiter but only returns the last reject error. Which is not accurate, so here I aggregate each error.

**Release note**:

```release-note
NONE
```
2018-08-02 19:57:10 -07:00
Kubernetes Submit Queue 695d4fb584
Merge pull request #66684 from deads2k/rbac-01-aggregate
Automatic merge from submit-queue (batch tested with PRs 65730, 66615, 66684, 66519, 66510). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

aggregate admin from edit and view to ensure coverage

ClusterRole aggregate has worked quite well.  This updates the edit role to be aggregated from a separate edit and view and updates the admin role to aggregated from admin, edit, and view.  This ensures coverage (we previously had unit tests, but that didn't work as people aggregated more powers in) and it makes each role smaller since it only has a diff to consider.

@kubernetes/sig-auth-pr-reviews 

```release-note
admin RBAC role now aggregates edit and view.  edit RBAC role now aggregates view. 
```
2018-08-01 15:52:13 -07:00
Karol Gołąb 786a0c6294 Refactor checkRequest to allow it to be called from outside of admission controller 2018-08-01 16:15:27 +02:00
Kubernetes Submit Queue 14ee31b7e3
Merge pull request #66014 from yue9944882/cleanup-podpreset-unused-methods
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Clean up podpreset admission controller unused methods

**What this PR does / why we need it**:
As the title.
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-31 10:49:57 -07:00
Pengfei Ni 6bfd2be2ea Add documentation and unit tests 2018-07-30 13:32:57 +08:00
Pengfei Ni b258bbad6a Implement PersistentVolumeLabel admission controller for AzureDisk 2018-07-30 13:31:12 +08:00
stewart-yu f1343af5d7 auto-generated file 2018-07-28 07:54:17 +08:00
stewart-yu 55251c716a update the import file for move util/pointer to k8s.io/utils 2018-07-27 19:47:02 +08:00
Ardalan Kangarlou ee747b8649 Changed admission controller to allow volume expansion for all volume plugins
There are two motivations for this change:
(1) CSI plugins are soon going to support volume expansion. For such
plugins, admission controller doesn't know whether the plugins are
capabale of supporting volume expansion or not.
(2) Currently, admission controller rejects PVC updates for in-tree plugins
that don't support volume expansion (e.g., NFS, iSCSI). This change allows
external controllers to expand volumes similar to how external provisioners
operate.
2018-07-27 03:06:48 -04:00
David Eads 3c1495d0a4 aggregate admin from edit and view to ensure coverage 2018-07-26 15:14:34 -04:00
Kubernetes Submit Queue 8770d12494
Merge pull request #65572 from yue9944882/fixes-admission-operation-mismatch-for-create-on-update
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fixes operation for "create on update"

**What this PR does / why we need it**:

Set operation to `admission.Create` for create-on-update requests.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #65553

**Special notes for your reviewer**:

**Release note**:

```release-note
Checks CREATE admission for create-on-update requests instead of UPDATE admission
```
2018-07-19 10:42:54 -07:00
Kubernetes Submit Queue d2cc34fb07
Merge pull request #65771 from smarterclayton/untyped
Automatic merge from submit-queue (batch tested with PRs 65771, 65849). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add a new conversion path to replace GenericConversionFunc

reflect.Call is very expensive. We currently use a switch block as part of AddGenericConversionFunc to avoid the bulk of top level a->b conversion for our primary types which is hand-written. Instead of having these be handwritten, we should generate them.

The pattern for generating them looks like:

```
scheme.AddConversionFunc(&v1.Type{}, &internal.Type{}, func(a, b interface{}, scope conversion.Scope) error {
  return Convert_v1_Type_to_internal_Type(a.(*v1.Type), b.(*internal.Type), scope)
})
```

which matches AddDefaultObjectFunc (which proved out the approach last year). The
conversion machinery should then do a simple map lookup based on the incoming types and invoke the function.  Like defaulting, it's up to the caller to match the types to arguments, which we do by generating this code.  This bypasses reflect.Call and in the future allows Golang mid-stack inlining to optimize this code.

As part of this change I strengthened registration of custom functions to be generated instead of hand registered, and also strengthened error checking of the generator when it sees a manual conversion to error out.  Since custom functions are automatically used by the generator, we don't really have a case for not registering the functions.

Once this is fully tested out, we can remove the reflection based path and the old registration methods, and all conversion will work from point to point methods (whether generated or custom).

Much of the need for the reflection path has been removed by changes to generation (to omit fields) and changes to Go (to make assigning equivalent structs easy).

```release-note
NONE
```
2018-07-19 09:29:00 -07:00
Tim Allclair 5ace0f03d8
Cleanup & fix PodSecurityPolicy field path usage 2018-07-18 17:47:32 -07:00
Clayton Coleman ef561ba8b5
generated: Avoid use of reflect.Call in conversion code paths 2018-07-17 23:02:16 -04:00
Russ Cox 2bd91dda64 kubernetes: fix printf format errors
These are all flagged by Go 1.11's
more accurate printf checking in go vet,
which runs as part of go test.

Lubomir I. Ivanov <neolit123@gmail.com>
applied ammend for:
  pkg/cloudprovider/provivers/vsphere/nodemanager.go
2018-07-11 00:10:15 +03:00
yue9944882 ccb1ec7a36 fixes operation for "create on update"
remove create-on-update logic for quota controller

review: add more error check

remove unused args

revert changes in patch.go

use hasUID to judge if it's a create-on-update
2018-07-10 17:22:09 +08:00
yue9944882 126716287b clean ups 2018-07-10 17:08:35 +08:00
Kubernetes Submit Queue 349d6a62db
Merge pull request #64226 from ddebroy/ddebroy-affinity1
Automatic merge from submit-queue (batch tested with PRs 64226, 65880). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Populate NodeAffinity on top of labels for cloud based PersistentVolumes

**What this PR does / why we need it**:

This PR populates the NodeAffinity field (on top of the existing labels) for PVs backed by cloud providers like EC2 EBS and GCE PD.

**Special notes for your reviewer**:
Related to https://github.com/kubernetes/kubernetes/pull/63232

Sample `describe pv` output for EBS with node affinity field populated:
```
kubectl describe pv pv0001
Name:              pv0001
Labels:            failure-domain.beta.kubernetes.io/region=us-west-2
                   failure-domain.beta.kubernetes.io/zone=us-west-2a
Annotations:       <none>
Finalizers:        [kubernetes.io/pv-protection]
StorageClass:      
Status:            Available
Claim:             
Reclaim Policy:    Retain
Access Modes:      RWO
Capacity:          5Gi
Node Affinity:     
  Required Terms:  
    Term 0:        failure-domain.beta.kubernetes.io/zone in [us-west-2a]
                   failure-domain.beta.kubernetes.io/region in [us-west-2]
Message:           
Source:
    Type:       AWSElasticBlockStore (a Persistent Disk resource in AWS)
    VolumeID:   vol-00cf03a068c62cbe6
    FSType:     ext4
    Partition:  0
    ReadOnly:   false
Events:         <none>
```

/sig storage
/assign @msau42

**Release note**:
```NONE```
2018-07-09 12:16:02 -07:00
Jordan Liggitt 1c012f1c49
Improve multi-authorizer errors 2018-07-06 10:55:17 -04:00
Jordan Liggitt bfd966c4c2
update priority admission for interoperability 2018-07-03 10:43:35 -04:00
Bobby (Babak) Salamat a1472459a5 Addressed reviewers comments 2018-06-29 10:22:11 -07:00
hzxuzhonghu 6197ab23d1 EventRateLimit should aggregate reject errors 2018-06-29 14:30:22 +08:00
Bobby (Babak) Salamat 28df1f0d0c Autogenerated files 2018-06-28 17:43:30 -07:00
Bobby (Babak) Salamat 1ce7585924 Limit usage of system critical priority classes to the system namespace 2018-06-28 17:43:30 -07:00
Deep Debroy 074dc6487b Populate NodeAffinity on top of labels for cloud based PersistentVolumes
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2018-06-26 19:48:03 -07:00
Jeff Grafton 23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Jeff Grafton a725660640 Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
Kubernetes Submit Queue f7de67a191
Merge pull request #64598 from MikeSpreitzer/fix-63608-b
Automatic merge from submit-queue (batch tested with PRs 65152, 65199, 65179, 64598, 65216). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove optimization from getWork in resourcequota/controller.go

**What this PR does / why we need it**:
This change simplifies the code in
plugin/pkg/admission/resourcequota/controller.go by removing the
optimization in getWork that required the caller to NOT call
completeWork if getWork returns the empty list of work.  BTW, the
caller was not obeying that requirement; now the caller's behavior
(which is unchanged) is right.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #63608 

**Special notes for your reviewer**:
This is a simpler alternative to #64377 

**Release note**:

```release-note
NONE
```
2018-06-21 18:20:15 -07:00