Commit Graph

2477 Commits (237007b6159ebebaa29cb576591180e0ae569842)

Author SHA1 Message Date
Kubernetes Submit Queue ecdf31d56c
Merge pull request #55221 from CaoShuFeng/priority
Automatic merge from submit-queue (batch tested with PRs 54987, 55221, 54099, 55144, 54215). 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>.

not calculate new priority when user update other spec of a pod

motivation of this change:
If we update the priority, pod validation mechanism will prevent this update
request, this is not expected.

**Release note**:
```
Priority admission controller: not calculate new priority when user update a pod
```
2017-11-10 14:51:25 -08:00
Dr. Stefan Schimanski 1e79dfb959 Update generated code 2017-11-10 18:26:46 +01:00
Dr. Stefan Schimanski 72809a08b9 deepcopy: remove deepcopy register tags 2017-11-10 18:25:26 +01:00
Kubernetes Submit Queue a43c6e41d5
Merge pull request #55291 from hzxuzhonghu/admission-initializer
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>.

remove redundant code in admission initializer

**What this PR does / why we need it**:
remove unused return error in `k8s.io\kubernetes\staging\src\k8s.io\apiserver\pkg\admission\initializer\initializer.go`

**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
```
2017-11-10 05:38:08 -08:00
Cao Shufeng 1440949dc6 not calculate new priority when user update pods
motivation of this change:
If we update the priority, pod validation mechanism will prevent this update
request, this is not expected.
2017-11-10 16:10:51 +08:00
chenxingyu 954c97fe6d add e2e test on the hostport predicates 2017-11-10 15:44:23 +08:00
chenxingyu 2d44ef9dfa add hostip protocol to the hostport predicates and make unit test adapt to the code change 2017-11-10 15:41:52 +08:00
Dr. Stefan Schimanski b9efab0eb2 admission: split PodSecurityPolicy into mutating and validating part 2017-11-09 15:41:25 +01:00
Kubernetes Submit Queue c2a5a79ed6
Merge pull request #55252 from deads2k/admission-15-save-SA
Automatic merge from submit-queue (batch tested with PRs 53651, 55252). 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>.

split serviceaccount admission into mutation and validation

Splits the SA admission plugin into mutation and validation halves.

I had some trouble with e2e tests before, so this got split out of another pull.
2017-11-09 06:18:11 -08:00
Gavin bed435deca compute pod selectors in priority meta data producer 2017-11-09 20:21:17 +08:00
Gavin 4aa92bac73 Refactoring of priority function(CaculateSpreadPriority) by using map/reduce pattern 2017-11-09 20:21:13 +08:00
Dr. Stefan Schimanski bec617f3cc Update generated files 2017-11-09 12:14:08 +01:00
Dr. Stefan Schimanski 012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Dr. Stefan Schimanski d13b936a2a pkg/apis/core: fixup conversion func names in dependencies 2017-11-09 12:14:07 +01:00
Kubernetes Submit Queue 4886a7091b
Merge pull request #55311 from CaoShuFeng/scheduler-trivial
Automatic merge from submit-queue (batch tested with PRs 53747, 54528, 55279, 55251, 55311). 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>.

[trivil] fix comment in kube-scheduler

**Release note**:
```
NONE
```
2017-11-08 19:31:15 -08:00
Kubernetes Submit Queue 412271d4d3
Merge pull request #55251 from deads2k/admission-13-toleration
Automatic merge from submit-queue (batch tested with PRs 53747, 54528, 55279, 55251, 55311). 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>.

update podtolerations admission to mutate and validate separately

Updates the podtolerations admission plugin to mutate and validate separately.  This also fixes the bug where the toleration whitelist isn't respected for memory pressure.

```release-note-action-required
The `node.kubernetes.io/memory-pressure` taint now respects the configured whitelist.  If you need to use it, you'll have to add it to the whitelist.
```
2017-11-08 19:31:12 -08:00
Kubernetes Submit Queue 17f7183e74
Merge pull request #55172 from hongshibao/master
Automatic merge from submit-queue (batch tested with PRs 54493, 52501, 55172, 54780, 54819). 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>.

Fix divide by zero issue in calculating spread priority for zones

```release-note
NONE
```
2017-11-08 15:41:18 -08:00
Kubernetes Submit Queue 648cc300b9
Merge pull request #54854 from kawych/hpa_roles
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>.

Allow HPA to get custom metrics

**What this PR does / why we need it**:
This PR allows HPA to read custom metrics.

**Release note**:
```release-note
Allow HPA to read custom metrics.
```
2017-11-08 13:16:37 -08:00
Yongkun Anfernee Gui 4be6a60df2 Refactor Priority Reduce functions
- Reducing the duplicated reduce function by introducing a reduce
  function generator that generates common reduce functions.
- Remove logs from reduce function, so it's purely calculating scores.
- Optimize the reduce functions by removing unnecessary conversion to
  float64.
2017-11-08 10:00:23 -08:00
Cao Shufeng 612b334fb9 [trivil] fix comment in kube-scheduler 2017-11-08 17:42:46 +08:00
Kubernetes Submit Queue 33f873dbbe
Merge pull request #55262 from liggitt/schedulercache
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>.

Fix 'Schedulercache is corrupted' error

Fixes #50916

If an Assume()ed pod is Add()ed with a different nodeName, the podStates view of the pod is not corrected to reflect the actual nodeName. On the next Update(), the scheduler observes the mismatch and process exits.

```release-note
Fixed 'Schedulercache is corrupted' error in kube-scheduler
```
2017-11-07 23:23:33 -08:00
hzxuzhonghu 9d1e6d3e2c remove redundant code in admission initializer 2017-11-08 10:54:06 +08:00
Jordan Liggitt a366e6ced0
Fix 'Schedulercache is corrupted' error 2017-11-07 18:49:49 -05:00
Kubernetes Submit Queue e1de2ad507
Merge pull request #52562 from ironcladlou/kube-scheduler-config
Automatic merge from submit-queue (batch tested with PRs 53592, 52562, 55175, 55213). 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 kube-scheduler config API, command, and server setup

Refactor the kube-scheduler configuration API, command setup, and server setup according to the guidelines established in #32215 and using the kube-proxy refactor (#34727) as a model of a well factored component adhering to said guidelines.

* Config API: clarify meaning and use of algorithm source by replacing modality derived from bools and string emptiness checks with an explicit AlgorithmSource type hierarchy.
* Config API: consolidate client connection config with common structs.
* Config API: split and simplify healthz/metrics server configuration.
* Config API: clarify leader election configuration.
* Config API: improve defaulting.
* CLI: deprecate all flags except `--config`.
* CLI: port all flags to new config API.
* CLI: refactor to match kube-proxy Cobra command style.
* Server: refactor away configurator.go to clarify application wiring.
* Server: refactor to more clearly separate wiring/setup from running.

Fixes https://github.com/kubernetes/kubernetes/issues/52428.

@kubernetes/api-reviewers 
@kubernetes/sig-cluster-lifecycle-pr-reviews 
@kubernetes/sig-scheduling-pr-reviews 

/cc @ncdc @timothysc @bsalamat

```release-note
The kube-scheduler command now supports a `--config` flag which is the location of a file containing a serialized scheduler configuration. Most other kube-scheduler flags are now deprecated.
```
2017-11-07 11:21:19 -08:00
Kubernetes Submit Queue 26986e8407
Merge pull request #55058 from deads2k/admission-11-split-doubles
Automatic merge from submit-queue (batch tested with PRs 53273, 55058, 55237, 50140). 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>.

split some admission plugins into mutation and validation halves

Splits the podnodeselector, serviceaccount, and priority admission plugins into validating and mutating admission plugins.

@kubernetes/sig-api-machinery-pr-reviews
2017-11-07 09:39:39 -08:00
Kubernetes Submit Queue d33077526a
Merge pull request #53273 from mikedanese/authtristate
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 support for short-circuit deny in union authorizer

This change has no behavioral changes.

Fixes https://github.com/kubernetes/kubernetes/issues/51862

```release-note
Add support for the webhook authorizer to make a Deny decision that short-circuits the union authorizer and immediately returns Deny. 
```
2017-11-07 09:25:37 -08:00
David Eads d701834c80 split serviceaccount admission into mutation and validation 2017-11-07 12:12:28 -05:00
David Eads 84e6251046 update podtolerations admission to mutate and validate separately 2017-11-07 11:56:12 -05:00
Dan Mace efb2bb71cd Refactor scheduler config API
Refactor the kube-scheduler configuration API, command setup, and server
setup according to the guidelines established in #32215 and using the
kube-proxy refactor (#34727) as a model of a well factored component
adhering to said guidelines.

* Config API: clarify meaning and use of algorithm source by replacing
modality derived from bools and string emptiness checks with an explicit
AlgorithmSource type hierarchy.
* Config API: consolidate client connection config with common structs.
* Config API: split and simplify healthz/metrics server configuration.
* Config API: clarify leader election configuration.
* Config API: improve defaulting.
* CLI: deprecate all flags except `--config`.
* CLI: port all flags to new config API.
* CLI: refactor to match kube-proxy Cobra command style.
* Server: refactor away configurator.go to clarify application wiring.
* Server: refactor to more clearly separate wiring/setup from running.

Fixes #52428.
2017-11-07 09:41:39 -05:00
Dan Mace 25ca287707 Update generated files 2017-11-07 09:41:35 -05:00
Kubernetes Submit Queue 32b761edf3
Merge pull request #54871 from anfernee/clean
Automatic merge from submit-queue (batch tested with PRs 55114, 52976, 54871, 55122, 55140). 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>.

haveSame is suboptimal, fix it as well as the name

**What this PR does / why we need it**: Make the util function simpler, also faster by reducing a for loop.

**Special notes for your reviewer**:

**Release note**:
```release-note
None
```
2017-11-06 23:19:18 -08:00
hongshibao 2141b9edd5 Fix divide by zero issue in calculating spread priority for zones 2017-11-06 23:39:05 +08:00
David Eads 2c671614df split some admission plugins into mutation and validation halves 2017-11-06 09:07:00 -05:00
Kubernetes Submit Queue aed9ad4b08
Merge pull request #54778 from stewart-yu/addexplain
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 comment for preempt sunction.

**What this PR does / why we need it**:
Add explain for preempt sunction.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-04 15:42:20 -07:00
Mike Danese 12125455d8 move authorizers over to new interface 2017-11-03 13:46:28 -07:00
Kubernetes Submit Queue 6fe3a4d82a
Merge pull request #55000 from deads2k/admission-10-split
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>.

make easy validation admission plugins into validators

This switches "easy" admission plugins that need to be validators to be validators.  I also did one simple plugin to do both mutation and validation for practice.

@kubernetes/sig-api-machinery-pr-reviews @caesarxuchao
2017-11-03 06:33:17 -07:00
David Eads 75c448dbc7 make easy validation admission plugins into validators 2017-11-03 07:54:39 -04:00
Yongkun Anfernee Gui 5d268eb1d3 haveSame is suboptimal, fix it as well as the name 2017-11-02 22:50:32 -07:00
Kubernetes Submit Queue 2084f7f4f3
Merge pull request #54488 from lichuqiang/plugin_base
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 admission handler for device resources allocation

**What this PR does / why we need it**:
Add admission handler for device resources allocation to fail fast during pod creation

**Which issue this PR fixes** 
fixes #51592

**Special notes for your reviewer**:
@jiayingz Sorry, there is something wrong with my branch in #51895. And I think the existing comments in the PR might be too long for others to view. So I closed it and opened the new one, as we have basically reach an agreement on the implement :)
I have covered the functionality and unit test part here, and would set about the e2e part ASAP

/cc @jiayingz @vishh @RenaudWasTaken 

**Release note**:

```release-note
NONE
```
2017-11-02 17:24:06 -07:00
Kubernetes Submit Queue 40212c17cd
Merge pull request #54484 from sttts/sttts-split-psp
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>.

admission: wire through validating-only admission

Based on https://github.com/kubernetes/kubernetes/pull/54232.

This is important and required for beta because it affects the shape of the webhook admission plugins that are going to be produced and is needed to make sure that our existing chain continues to properly verify and protect the API objects based on their final state after webhook admission mutators run.

We discussed this in the October 11 API machinery call with @erictune and @caesarxuchao and we agreed to do this as a requirement for beta. See this part of the recording: https://www.youtube.com/watch?v=mrgDPHyr4VY#t=325 .
2017-11-02 04:02:34 -07:00
Kubernetes Submit Queue e989ca4e63
Merge pull request #54812 from aveshagarwal/master-pod-toleration-restrictions-issues
Automatic merge from submit-queue (batch tested with PRs 54800, 53898, 54812, 54921, 53558). 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 override of cluster level (default, whitelist) tolerations by namespace level empty (default, whitelist) tolerations.

Currently In PodTolerationRestriction admission plugin, if namespace level default and whitelist of tolerations are nil or empty, they do not override cluster level default and whitelist tolerations. 

This PR fixes the plugin to not override cluster level tolerations only when namespace level toleration are nil. IOW, if namespace level toleration are empty, they override cluster level tolerations. To be more clear, if following annotations are set to empty, they override cluster level tolerations.
 
``` 
scheduler.alpha.kubernetes.io/defaultTolerations : ""
scheduler.alpha.kubernetes.io/tolerationsWhitelist: ""
```

This behavior is inline with PodNodeSelector admission plugin too.

@sjenning @derekwaynecarr 

**Release Note**:

```release-note
In PodTolerationRestriction admisson plugin, if namespace level tolerations are empty, now they override cluster level tolerations. 
```
2017-11-02 03:14:21 -07:00
Dr. Stefan Schimanski aedcf681b3 admission: rename Validate{ -> Initialization}, Validat{ingAdmit -> e} 2017-11-02 09:29:55 +01:00
Dr. Stefan Schimanski 2452afffe0 admission: wire create+update validation func into kube registries 2017-11-02 09:29:16 +01:00
Dr. Stefan Schimanski 74b4223ab8 admission: complete plumbing of validation admission 2017-11-02 08:45:41 +01:00
Dr. Stefan Schimanski 970d2553cc admission: { -> Mutating}Admit(admission.Attributes) 2017-11-02 08:45:41 +01:00
lichuqiang ebd445eb8c add admission handler for device resources allocation 2017-11-02 09:17:48 +08:00
Yongkun Anfernee Gui 8465625bd7 Optimize the suboptimal image locality algorithm 2017-11-01 10:18:59 -07:00
Avesh Agarwal 13289d2218 Allow override of cluster level (default, whitelist) tolerations by namespace level empty (default, whitelist) tolerations. 2017-11-01 10:47:52 -04:00
Karol Wychowaniec 69d81c926a Allow HPA to get custom metrics 2017-10-31 11:46:07 +01:00
Stewart-YU bc2845ee08 Add explain for preempt sunction. 2017-10-31 08:27:52 +08:00
Kubernetes Submit Queue 7a944a69d6
Merge pull request #54485 from sttts/sttts-unify-admission-constructors
Automatic merge from submit-queue (batch tested with PRs 54761, 54748, 53991, 54485, 46951). 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>.

admission: unify plugin constructors

It's common in Go to return the actual object in constructors, not **one interface**
it implements. This allows us to implement multiple interfaces, but only have
one constructor. As having private types in constructors, we export all plugin structs, of course with private fields.

Note: super interfaces do not work if there are overlapping methods.
2017-10-30 15:38:33 -07:00
Dr. Stefan Schimanski ce6ecbbc54 Remove all api.Scheme references by using explicit package aliases 2017-10-30 19:54:02 +01:00
Kubernetes Submit Queue 9c35982e1a
Merge pull request #54691 from wackxu/priadm
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>.

update wrong group for priorityclasses

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

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

**Special notes for your reviewer**:

assgin @bsalamat 

**Release note**:

```release-note
NONE
```
2017-10-30 10:31:03 -07:00
Dr. Stefan Schimanski 131905cdb8 admission: unify plugin constructors 2017-10-30 16:56:38 +01:00
Kubernetes Submit Queue 7c96feb298
Merge pull request #54047 from kuramal/my
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>.

Optimize Repeated registration of AlgorithmProvider when ApplyFeatureGates

**What this PR does / why we need it**:
modified ApplyFeatureGates() just add/del features, cancel the register of all AlgorithmProvider.

 there is Repeated registration of all AlgorithmProvider when ApplyFeatureGates() runs;
AlgorithmProvider have already registered when  package defaults loaded;
I think ApplyFeatureGates() is just add/del features, it needn't  register all AlgorithmProvider again
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```/release-note-none
```
2017-10-29 20:42:48 -07:00
wackxu 2430c24c61 update wrong group for priorityclasses 2017-10-28 10:35:41 +08:00
Kubernetes Submit Queue 27ef37a32d
Merge pull request #54320 from derekwaynecarr/quota-update
Automatic merge from submit-queue (batch tested with PRs 54331, 54655, 54320, 54639, 54288). 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>.

Ability to do object count quota for all namespaced resources

**What this PR does / why we need it**:
- Defines syntax for generic object count quota `count/<resource>.<group>`
- Migrates existing objects to support new syntax with old syntax
- Adds support to quota all standard namespace resources 
- Updates the controller to do discovery and replenishment on those resources
- Updates unit tests
- Tweaks admission configuration around quota
- Add e2e test for replicasets (demonstrate dynamic generic counting)

```
$  kubectl create quota test --hard=count/deployments.extensions=2,count/replicasets.extensions=4,count/pods=3,count/secrets=4
resourcequota "test" created
$ kubectl run nginx --image=nginx --replicas=2
$ kubectl describe quota
Name:                         test
Namespace:                    default
Resource                      Used  Hard
--------                      ----  ----
count/deployments.extensions  1     2
count/pods                    2     3
count/replicasets.extensions  1     4
count/secrets                 1     4
```

**Special notes for your reviewer**:
- simple object count quotas no longer require writing code
- deferring support for custom resources pending investigation about how to share caches with garbage collector.  in addition, i would like to see how this integrates with downstream quota usage in openshift.

**Release note**:
```release-note
Object count quotas supported on all standard resources using `count/<resource>.<group>` syntax
```
2017-10-27 15:42:24 -07:00
Kubernetes Submit Queue 7d628db7cb
Merge pull request #54657 from anfernee/sched
Automatic merge from submit-queue (batch tested with PRs 54635, 54250, 54657, 54696, 54700). 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 unused pods in genericScheduler

**What this PR does / why we need it**: source code cleanup. less confusion.

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2017-10-27 14:38:26 -07:00
Derek Carr 5b4ca14307 Update admission control framework for quota 2017-10-27 11:08:14 -04:00
Kubernetes Submit Queue 3a5eab236f Merge pull request #54538 from WIZARD-CXY/updatehostPort
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>.

delete the hostport from usedmap

**What this PR does / why we need it**:
delete the hostport record when pod is not on the host

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

Facilitate the further pr https://github.com/kubernetes/kubernetes/pull/52421. Because the code which detects the conflict between wantports and existingports is not quite clean now.
Besides remove the unused port from map will save the memory.

**Special notes for your reviewer**:

I and the original coder @k82cn agreed to make this change

**Release note**:

```release-note
NONE
```
2017-10-27 02:18:41 -07:00
Yongkun Anfernee Gui 6ef9cf4936 Remove unused pods in genericScheduler 2017-10-26 15:23:26 -07:00
David Eads 8c1fe1f61a move webhook admission to generic apiserver 2017-10-26 07:45:49 -04:00
Kubernetes Submit Queue 32847aab1d Merge pull request #51783 from jiulongzaitian/myfeature3
Automatic merge from submit-queue (batch tested with PRs 54081, 54271, 51783, 54600, 54594). 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>.

move getMaxVols function to predicates.go and add some NewVolumeCount…

…Predicate funcs

Signed-off-by: zhangjie <zhangjie0619@yeah.net>



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
move getMaxVols function to predicates.go and add some NewVolumeCountPredicate funcs
```
2017-10-26 02:43:48 -07:00
zhangjie 968df828a0 move getMaxVols function to predicates.go and change the params of NewMaxPDVolumeCountPredicate funcs
Signed-off-by: zhangjie <zhangjie0619@yeah.net>
2017-10-26 12:11:09 +08:00
chentao1596 222470684c Adding unit tests to methods of 'plugin/pkg/scheduler/algorithm/priorities/util' 2017-10-26 11:22:42 +08:00
kuramal a48cc26443 Optimize Repeated registration of AlgorithmProvider when ApplyFeatureGates
Add InsertPredicateKeyToAlgorithmProviderMap() and RemovePredicateKeyFromAlgorithmProviderMap() to insert/remove fit predicate key of all algorithmProviders which in algorithmProviderMap
Add Func RemovePredicateKeyFromAlgoProvider() AND InsertPredicateKeyToAlgoProvider() which can insert/remove fit predicate key to specific algorithmProvider
2017-10-26 10:10:48 +08:00
Kubernetes Submit Queue 17638ee018 Merge pull request #54414 from deads2k/admission-08-options
Automatic merge from submit-queue (batch tested with PRs 53760, 48996, 51267, 54414). 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>.

update admission webhook to handle multiple auth domains

Fixes https://github.com/kubernetes/kubernetes/issues/54404

Adds some wiring to have the admission plugin accept a config file for per-apiserver configuration.

@kubernetes/sig-auth-api-reviews @deads2k @ericchiang @liggitt in particular
@kubernetes/sig-api-machinery-pr-reviews @lavalamp @caesarxuchao @sttts @cheftako

```release-note
generic webhook admission now takes a config file which describes how to authenticate to webhook servers
```
2017-10-25 17:37:11 -07:00
chenxingyu 195de933f1 delete the hostport from usedmap 2017-10-25 15:49:18 +08:00
Bobby (Babak) Salamat ccc62412a3 Autogenerated files 2017-10-24 16:04:58 -07:00
Bobby (Babak) Salamat 5497e893ae Change type of scheduling queue from cache.FIFO to a new interface 2017-10-24 16:04:58 -07:00
Haoran Wang 4b185b4db9 update scheduler to use schedulerName selector 2017-10-24 13:31:38 +08:00
Kubernetes Submit Queue 6a444673b9 Merge pull request #53914 from bsalamat/pdb
Automatic merge from submit-queue (batch tested with PRs 53903, 53914, 54374). 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 PodDisruptionBudget to scheduler cache.

**What this PR does / why we need it**:
This is the first step to add support for PodDisruptionBudget during preemption. This PR adds PDB to scheduler cache.

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

**Special notes for your reviewer**: None

**Release note**:

```release-note
Add PodDisruptionBudget to scheduler cache.
```

ref/ #53913
2017-10-23 12:27:06 -07:00
Kubernetes Submit Queue fd3878a59d Merge pull request #54333 from liggitt/webhook-service-resolver
Automatic merge from submit-queue (batch tested with PRs 54363, 54333). 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>.

Ensure port on resolved service host

The resolved host should include a port so it can be used by dialers directly. It's also not necessary to reparse the URL when constructing directly.

```release-note
NONE
```
2017-10-23 11:30:25 -07:00
David Eads fd4ab3e061 update admission webhook to handle multiple auth domains 2017-10-23 12:33:54 -04:00
Kubernetes Submit Queue 3812230f4d Merge pull request #48963 from Raffo/master
Automatic merge from submit-queue (batch tested with PRs 52792, 48963). 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>.

Fix range for min value in imagepolicy admission 

**What this PR does / why we need it**:
This makes the range for imagepolicy admission work properly. Currently if we specify `1s` for the value of `AllowTTL` or `DenyTTL` in the configuration yaml, we get a message like the following: 

```
Error: failed to initialize plugins: Couldn't init admission plugin "ImagePolicyWebhook": valid value is between 1s and 30m0s, got 1s
```

This is due to a wrong comparison which is fixed in this PR. The rest of the PR just adds tests for this behaviour.
2017-10-21 15:10:12 -07:00
Bobby (Babak) Salamat efc151f46b Autogenerated files 2017-10-20 23:22:03 -07:00
Bobby (Babak) Salamat 9a5d058e5e Add PodDisruptionBudget to scheduler cache. 2017-10-20 23:22:02 -07:00
Jordan Liggitt d45f01e953
Ensure port on resolved service host 2017-10-20 23:01:11 -04:00
Bobby (Babak) Salamat ffa9ed60a8 Fix scheduler permission to patch pods 2017-10-20 18:04:37 -07:00
Kubernetes Submit Queue 10cafb8390 Merge pull request #54309 from liggitt/replicaset-permissions
Automatic merge from submit-queue (batch tested with PRs 52147, 54309). 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>.

Update bootstrap policy with replicaset/daemonset permissions in the apps API group

Resolves #54310

Bootstrap policy was not updated when replicasets and daemonsets got promoted to the apps group

```release-note
Resolves forbidden error when accessing replicasets and daemonsets via the apps API group
```
2017-10-20 14:58:14 -07:00
Jordan Liggitt 3789051726
Update bootstrap policy with replicaset/daemonset permissions in the apps API group 2017-10-20 12:59:39 -04:00
Kubernetes Submit Queue fe6258fb9b Merge pull request #54261 from yguo0905/sched-fix
Automatic merge from submit-queue (batch tested with PRs 54031, 54261). 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 absent Weight if PrioritizeVerb is empty

The scheduler currently validates `ExtenderConfig.Weight` (the weight applied to `Prioritize`) even when `ExtenderConfig.PrioritizeVerb` is empty, which is not correct. A configuration without these two fields should be allowed. 

**Release note**:
```
None
```

/sig scheduling
2017-10-20 02:26:58 -07:00
Kubernetes Submit Queue 2523e3ebae Merge pull request #53759 from anfernee/sched-test
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>.

Make scheduler integration test faster

Not to wait for 30 seconds for every negative test case. This commit
also organizes the test code to make it more readable.

It cuts the test time from 450s to 125s.

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

**Special notes for your reviewer**:

**Release note**: 
```release-note
NONE
```
2017-10-19 16:50:58 -07:00
Yang Guo 1c60898bf5 Allow absent Weight if PrioritizeVerb is empty 2017-10-19 15:10:44 -07:00
David Eads 4e79357f9f default admission hook failure safely 2017-10-19 14:30:39 -04:00
David Eads 0859798e8e update admission webhook to accept client config 2017-10-19 09:52:58 -04:00
David Eads 33deaedaf6 add url path for admission webhooks 2017-10-19 08:06:38 -04:00
Kubernetes Submit Queue 66222c3dbe Merge pull request #53982 from tizhou86/schedulerUnitTest7
Automatic merge from submit-queue (batch tested with PRs 52753, 54034, 53982, 54209). 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>.

Make test case description more accurate.

**What this PR does / why we need it**:
Make test case description more accurate. This test case tests the GCE persistent disk instead of the general one, change the name to make it consistent with AWS/Azure/ISCSI test cases.

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

**Special notes for your reviewer**:
NONE

**Release note**:

```release-note
NONE
```
2017-10-19 02:45:22 -07:00
Kubernetes Submit Queue 65d9b4ef0b Merge pull request #51450 from lichuqiang/typo_fix
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>.

fix bug in admission test

tiny bug fix
2017-10-18 21:40:51 -07:00
Kubernetes Submit Queue 3f2ce7e557 Merge pull request #51458 from CaoShuFeng/use_map_in_admit
Automatic merge from submit-queue (batch tested with PRs 51310, 51458, 47636). 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 useless allocation of map

This one-element map is only used for checking api. Remove it and
simplify the code.

**Release note**:
```
NONE
```
2017-10-18 20:47:07 -07:00
Kubernetes Submit Queue fa21e531f9 Merge pull request #49305 from zhangxiaoyu-zidif/fix-err-output-for-admission-test
Automatic merge from submit-queue (batch tested with PRs 49305, 54158). 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>.

fix error print for admission test

**What this PR does / why we need it**:
fix error print to make them easy to inspect.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
NONE
**Special notes for your reviewer**:
NONE
**Release note**:

```release-note
NONE
```
2017-10-18 16:35:17 -07:00
Kubernetes Submit Queue b3a9b802da Merge pull request #53823 from deads2k/admission-01-allow-fail
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>.

allow fail close webhook admission

Webhook admission needs to allow failing closed.  Even in an alpha state, I don't want to be one DDOS away from having an exposed cluster.

/assign caesarxuchao
/assign sttts
2017-10-18 14:49:54 -07:00
Kubernetes Submit Queue 900c0761e3 Merge pull request #53722 from deads2k/rbac-01-allow-star
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>.

allow */subresource in rbac policy rules

xref #29698
xref #38756
xref #49504
xref #38810

Allow `*/subresource` format in RBAC policy rules to support polymorphic subresources like `*/scale` for HPA.

@DirectXMan12 fyi

```release-note
RBAC PolicyRules now allow resource=`*/<subresource>` to cover `any-resource/<subresource>`.   For example, `*/scale` covers `replicationcontroller/scale`.
```
2017-10-18 14:02:05 -07:00
Kubernetes Submit Queue 1bea47aaca Merge pull request #53896 from deads2k/admission-03-decode
Automatic merge from submit-queue (batch tested with PRs 47717, 53896). 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>.

decode admission responses into a fresh object

Something about the way the admission request object is built causes decoding into back into it to fail with 

```
W1013 14:10:42.457423    2960 admission.go:185] rejected by webhook namespacereservations.admission.online.openshift.io/apis/admission.online.openshift.io/v1alpha1/namespacereservations &{%!t(string=namespacereservations.admission.online.openshift.io/apis/admission.online.openshift.io/v1alpha1/namespacereservations) %!t(*errors.errorString=&{reflect.Value.Addr of unaddressable value})}: failed calling admission webhook "namespacereservations.admission.online.openshift.io/apis/admission.online.openshift.io/v1alpha1/namespacereservations": reflect.Value.Addr of unaddressable value
```

This simply creates a fresh object to decode into, which works fine for our usage and makes it possible to actually have the webhook call out to something.
2017-10-18 11:52:06 -07:00
David Eads f81b6004de allow fail close webhook admission 2017-10-18 14:28:02 -04:00
Kubernetes Submit Queue 2d914ee703 Merge pull request #53984 from sttts/sttts-legacyscheme
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>.

pkg/api: extract Scheme/Registry/Codecs into pkg/api/legacyscheme

This serves as

- a preparation for the pkg/api->pkg/apis/core move
- and makes the dependency to the scheme explicit when vizualizing
  left depenncies.

The later helps with our our efforts to split up the monolithic repo
into self-contained sub-repos, e.g. for kubectl, controller-manager
and kube-apiserver in the future.
2017-10-18 10:49:10 -07:00
Kubernetes Submit Queue f1b17e8896 Merge pull request #53995 from deads2k/admission-04-owner
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 deads to admission owners

/assign derekwaynecarr
2017-10-18 08:27:23 -07:00
Dr. Stefan Schimanski cad0364e73 Update bazel 2017-10-18 17:24:04 +02:00
Dr. Stefan Schimanski 7773a30f67 pkg/api/legacyscheme: fixup imports 2017-10-18 17:23:55 +02:00
Kubernetes Submit Queue d462bac780 Merge pull request #54043 from x1957/fix_comment
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>.

fix the bad code comment 

**What this PR does / why we need it**:
fix the bad code comment in scheduler

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

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2017-10-17 23:50:06 -07:00
Kubernetes Submit Queue 229cbf4b6d Merge pull request #54030 from dims/fix-go1.9-admission-webhook-test-failure
Automatic merge from submit-queue (batch tested with PRs 54030, 54041). 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>.

Fix admission webhook test failure in go1.9

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

Go 1.9 has some better checks for SAN extensions, notably:
630e93ed2d

We recently added ServerName to the rest client TLSConfig:
186a0684d5 (diff-eb3573c6b11347dc3793c477726480efR262)

So we need to be sure that the ServerName "webhook-test.default.svc" is
present in the certificates that we generate."

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

Fixes #54020

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-17 21:26:00 -07:00
Yuhao Fang 3ef6a09cc0 fix the bad code comment in scheduler package 2017-10-18 09:59:24 +08:00
Kubernetes Submit Queue 4105ccac78 Merge pull request #53989 from shyamjvs/use-counter-in-scheduler
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>.

Remove repeated random string generations in scheduler volume predicate

Ref https://github.com/kubernetes/kubernetes/issues/53327

@wojtek-t @liggitt @jsafrane - Does this look ok to you?
2017-10-17 18:43:36 -07:00
Shyam Jeedigunta 5a85f9d21c Remove repeated random string generations in scheduler volume predicate 2017-10-17 19:57:46 +02:00
Yongkun Anfernee Gui dc15e9cf90 Make scheduler integration test faster
Not to wait for 30 seconds for every negative test case. It cuts the
test time from 450s to 125s.
2017-10-17 10:32:46 -07:00
Kubernetes Submit Queue 0e21ac81c0 Merge pull request #51416 from justinsb/fix_nodeidentitifer_godocs
Automatic merge from submit-queue (batch tested with PRs 51416, 53535). 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>.

Fix NodeIdentifier godocs: IdentifyNode -> NodeIdentity
2017-10-17 08:44:13 -07:00
Kubernetes Submit Queue 76a4674bd4 Merge pull request #53739 from php-coder/remove_unused_functions_from_admission_test
Automatic merge from submit-queue (batch tested with PRs 54036, 53739). 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>.

admission_test.go: remove unused functions

**What this PR does / why we need it**:
PR removed unused `createNamespaceForTest()` and `createSAForTest()` functions from `admission_test.go`.

**Release note**:
```release-note
NONE
```

PTAL @liggitt @pweil- 
CC @simo5
2017-10-17 06:49:16 -07:00
Kubernetes Submit Queue 5152f342eb Merge pull request #54008 from yguo0905/sched-fix
Automatic merge from submit-queue (batch tested with PRs 53978, 54008, 53037). 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>.

Change scheduler to skip pod with updates only on pod annotations

Fixes #52914, by checking whether the pod is already assumed before scheduling it.

**Release note**:

```
Scheduler cache ignores updates to an assumed pod if updates are limited to pod annotations.
```

/sig scheduling
/assign @bsalamat 
/cc @vishh
2017-10-17 04:53:40 -07:00
Slava Semushin 1a3a2d47c8 admission_test.go: remove unused createNamespaceForTest() and createSAForTest() functions. 2017-10-17 12:03:46 +02:00
Davanum Srinivas 98509a9d05 Fix admission webhook test failure in go1.9
Go 1.9 has some better checks for SAN extensions, notably:
630e93ed2d

We recently added ServerName to the rest client TLSConfig:
186a0684d5 (diff-eb3573c6b11347dc3793c477726480efR262)

So we need to be sure that the ServerName "webhook-test.default.svc" is
present in the certificates that we generate."
2017-10-16 21:10:54 -04:00
Kubernetes Submit Queue 97808e5a86 Merge pull request #52849 from liggitt/psp-defaulting-order
Automatic merge from submit-queue (batch tested with PRs 48665, 52849, 54006, 53755). 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>.

Order PSP by name, prefer non-mutating PSPs

Fixes #36184
Fixes #23217
Related to #23217

Removes unnecessary mutation of pods:
* Determines effective security context for pods using a wrapper containing the pod and container security context, rather than building/setting a combined struct on every admission
* Does not set `privileged:&false` on security contexts with `privileged:nil`
* Does not set `runAsNonRoot:&true` on security contexts that already have a non-nil, non-0 `runAsUser`
* Does not mutate/normalize container capabilities unless changes are required (missing  defaultAddCapabilities or requiredDropCapabilities)

Defines behavior when multiple PSP objects allow a pod:
* PSPs which allow the pod as-is (no defaulting/mutating) are preferred
* If the pod must be defaulted/mutated to be allowed, the first PSP (ordered by name) to allow the pod is selected
* During update operations, when mutations to pod specs are disallowed, only non-mutating PSPs are used to validate the pod

```release-note
PodSecurityPolicy: when multiple policies allow a submitted pod, priority is given to ones which do not require any fields in the pod spec to be defaulted. If the pod must be defaulted, the first policy (ordered by name) that allows the pod is used.
```
2017-10-16 18:09:41 -07:00
Yang Guo 8b6bf4e235 Change scheduler to skip pod with only annotations updates 2017-10-16 13:30:25 -07:00
David Eads e8a703b651 allow */subresource in rbac policy rules 2017-10-16 16:17:51 -04:00
David Eads 926a615775 add deads to admission owners 2017-10-16 13:43:54 -04:00
Ti Zhou 3647a891d8 Make test case description more accurate. 2017-10-16 20:05:27 +08:00
Kubernetes Submit Queue 1ab5075c7c Merge pull request #52637 from stewart-yu/issue#06
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>.

Modify Schedule function

**What this PR does / why we need it**:
It is obvious that no need to prioritizing when only one node after predicate.

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

**Special notes for your reviewer**:
@davidopp @timothysc

**Release note**:

```release-note
NONE
```
2017-10-16 00:38:15 -07:00
Jordan Liggitt 8c5b01376a
PodSecurityPolicy: Order by name, prefer non-mutating policies, require *api.Pod, allow GC updates 2017-10-16 02:22:11 -04:00
Jordan Liggitt abc7c077e1
PodSecurityPolicy: avoid unnecessary mutation of supplemental groups 2017-10-16 02:21:10 -04:00
Jordan Liggitt b45b809f4c
PodSecurityPolicy: Do not mutate nil privileged field to false 2017-10-16 02:21:10 -04:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Kubernetes Submit Queue 16dbab9778 Merge pull request #53783 from tizhou86/schedulerUnitTest
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>.

Added more unit tests for kube-scheduler.

**What this PR does / why we need it**:
Added more unit tests for kube-scheduler.

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

**Special notes for your reviewer**:
NONE

**Release note**:

```release-note
NONE
```
2017-10-14 07:29:25 -07:00
stewart-yu 5937184db7 When only one node after predicate, just return it 2017-10-14 15:47:47 +08:00
Kubernetes Submit Queue 46ae7c4a30 Merge pull request #52903 from wackxu/mpi
Automatic merge from submit-queue (batch tested with PRs 53507, 53772, 52903, 53543). 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>.

Make configFactory private

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

Fix TODO make this private if possible, so that only its interface is externally used.
I have check the use of configFactory and it is safe to make it private.

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


**Release note**:

```release-note
NONE
```
2017-10-13 13:53:18 -07:00
David Eads 9adcbd72fb decode admission responses into a fresh object 2017-10-13 10:48:58 -04:00
Ti Zhou cb7d08f2c4 Update BUILD file by executing update-bazel.sh 2017-10-13 17:15:27 +08:00
Ti Zhou 2a910ff12c Tweak kube-schuduler unit test cases. 2017-10-13 10:40:47 +08:00
Wojciech Tyczynski 234e20b620 User separate client for leader election in scheduler 2017-10-12 13:44:35 +02:00
Ti Zhou d5febacc91 Added more unit tests for kube-scheduler. 2017-10-12 17:17:15 +08:00
Kubernetes Submit Queue d6b18a96dd Merge pull request #53611 from p0lyn0mial/pass_scheme_to_admission_plugins
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>.

removes k8s.io/kubernetes/pkg/api dependency from the webhook plugin.

**What this PR does / why we need it**: removes `k8s.io/kubernetes/pkg/api` dependency from `webhook` plugin. The runtime.scheme can be injected to the webhook from the plugin initializer.

**Release note**:

```
NONE
```
2017-10-10 13:53:27 -07:00
Kubernetes Submit Queue 6154a9e16c Merge pull request #53477 from caesarxuchao/genenic-initializer
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>.

Move initializer plugin to the generic apiserver

* Moves `k8s.io/kuberentes/plugin/pkg/admission/initialization` to `k8s.io/apiserver/pkg/admission/plugin/initialization`
* Moves `k8s.io/kubernetes/pkg/kubeapiserver/admission/configuration` to `k8s.io/apiserver/pkg/admission/configuration`
* The initializer plugin used to depend on `k8s.io/kubernetes` because it does a type assertion of `api.Pod`. It tries to skip mirror pod. I converted that code to use the generic accessor pattern.
2017-10-10 09:46:00 -07:00
p0lyn0mial fa96700b76 removes k8s.io/kubernetes/pkg/api dependency from the webhook plugin. 2017-10-09 22:25:03 +02:00
Chao Xu bbac32c299 generated 2017-10-09 10:58:12 -07:00
Chao Xu 89a0511fcb move initializer to the generic apiserver
move k8s.io/kubernetes/plugin/pkg/admission/initialization to
k8s.io/apiserver/pkg/admission/plugin/initialization/initialization.go;
move k8s.io/kubernetes/pkg/kubeapiserver/admission/configuration to
k8s.io/apiserver/pkg/admission/configuration.
2017-10-09 10:57:00 -07:00
Gavin 7f3c4ac1f4 clarify pridicates message when no nodes available
fix space

address comment
2017-10-07 08:17:04 +08:00
Kubernetes Submit Queue fe5c628e40 Merge pull request #53480 from k82cn/k8s_53425
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>.

Refresh scheduler equivalence cache when node taints changed.

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

**Release note**:
```release-note
None
```
2017-10-05 22:54:56 -07:00
Kubernetes Submit Queue c1703a4998 Merge pull request #53343 from p0lyn0mial/move_newAdmissionReview_method_to_webhook
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>.

moves admission.v1alpha1.NewAdmissionReview method to webhook plugin

**What this PR does / why we need it**:
this is necessary, because the webhook plugin will be moved down to apiserver.

**Release note**:

```
NONE
```
2017-10-05 02:24:14 -07:00
Klaus Ma 066c5e9657 Fixed alpha e2e test failure. 2017-10-05 15:33:31 +08:00
p0lyn0mial 187171284a moves admission.v1alpha1.NewAdmissionReview to webhook plugin
this is necessary, because the webhook plugin will be moved down to apiserver.
2017-10-04 19:50:27 +02:00
Kubernetes Submit Queue 8e30314c95 Merge pull request #53394 from p0lyn0mial/cleanup_kubeapi_admission_initializer
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>.

removes Authorizer and ExternalClientSet from kubeapiserver's admissi…

**What this PR does / why we need it**:
removes Authorizer and ExternalClientSet from kubeapiserver's admission initializer.


**Release note**:

```
NONE
```
2017-10-04 07:50:35 -07:00
Kubernetes Submit Queue 731f42172b Merge pull request #51266 from resouer/not-ready
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>.

Refactor node taint conditions

**What this PR does / why we need it**:
We should use `not-ready` etc as node condition taint key.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Use `not-ready` to replace `notReady` in node condition taint keys.
```
2017-10-04 06:56:44 -07:00
Kubernetes Submit Queue bfb7f3c2a7 Merge pull request #53135 from jsafrane/fix-predicate-counting
Automatic merge from submit-queue (batch tested with PRs 53135, 52512, 48339). 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>.

Fixed counting of unbound PVCs towards limit of attached volumes.

Count unbound PVCs to the limit of attached volumes to a node. 

When MaxPDVolumeCountPredicate is in doubt (e.g. PVC or PV is missing), it assumes the volume is attached. It should assume the same when it encounters an unbound PVC. In any case, it should not return an error, it would stop scheduling all pods with a PVC.

Fixes: #53134

```release-note
NONE
```
2017-10-03 13:08:13 -07:00
p0lyn0mial 6b1f1d1414 removes Authorizer and ExternalClientSet from kubeapiserver's admission initializer. 2017-10-03 18:08:30 +02:00
Kubernetes Submit Queue 0c6970bf7b Merge pull request #52723 from k82cn/k8s_42001_5
Automatic merge from submit-queue (batch tested with PRs 52723, 53271). 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>.

Apply algorithm in scheduler by feature gates.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: part of #42001

**Release note**:
```release-note
Apply algorithm in scheduler by feature gates.
```
2017-10-03 05:15:20 -07:00
Kubernetes Submit Queue 8eb37aee3a Merge pull request #53359 from liggitt/swagger.json
Automatic merge from submit-queue (batch tested with PRs 50749, 52869, 53359). 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 /swagger.json and /swagger-2.0.0.pb-v1 to discovery role

Allow access to openapi docs
Fixes #53349
2017-10-02 21:43:14 -07:00
Jordan Liggitt d657261f9b
Add /swagger.json and /swagger-2.0.0.pb-v1 to discovery role 2017-10-02 21:52:13 -04:00
Kubernetes Submit Queue dd99659dc1 Merge pull request #53156 from p0lyn0mial/move_admission_initializer_interfaces_to_apiserver
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>.

moved admission interfaces WantsClientCert, WantsAuthorizer and Wants…

**What this PR does / why we need it**:
moves some admission interfaces to apiserver, hopefully moving the webhook admission in the future will be much easier.

**Release note**:

```
NONE
```
2017-10-02 12:06:26 -07:00
Jan Safranek 2caae38d32 Fixed counting of unbound PVCs towards limit of attached volumes.
There are two ways how a scheduled pod can get its PVCs unbound:
- admin forcefuly unbinds it
- user deletes original PVC that was bound when the pod was scheduled and
  creates a new one with the same name that does not get bound from some
  reason.

In both cases we don't know where the original PVC pointed at and if we
should account it to the limit of attached AWS EBS / GCE PDs etc.

The common pattern here is to count it in when in doubt.
2017-10-02 15:49:34 +02:00
Kubernetes Submit Queue 2ec89d1e13 Merge pull request #53247 from surajssd/remove-unused-predicate-args-func
Automatic merge from submit-queue (batch tested with PRs 53247, 53319). 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 unused function addStorageLimit

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

In package `plugin/pkg/scheduler/algorithm/predicates` remove unused
unexported function `addStorageLimit`.


**Release note**:

```release-note
NONE
```
2017-10-02 04:51:26 -07:00
p0lyn0mial 475493ced6 moved admission interfaces WantsClientCert, WantsAuthorizer and WantsExternalKubeClientSet to apiserver 2017-10-01 15:03:08 +02:00
Klaus Ma bd15efd3e5 Enhance scheduler for TaintNodeByCondition. 2017-10-01 08:26:35 +08:00
Kubernetes Submit Queue 887598c2eb Merge pull request #52654 from liggitt/pdb-permissions
Automatic merge from submit-queue (batch tested with PRs 53263, 52967, 53262, 52654, 53187). 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 pod disruption budgets to admin/edit/view roles

Closes #50767

cc @kubernetes/sig-auth-pr-reviews @kubernetes/sig-node-pr-reviews

```release-note
RBAC: The default `admin` and `edit` roles now include read/write permissions and the `view` role includes read permissions on `poddisruptionbudget.policy` resources.
```
2017-09-29 13:37:30 -07:00
Suraj Deshmukh bf25a2753b remove unused function addStorageLimit
In package `plugin/pkg/scheduler/algorithm/predicates` remove unused
unexported function `addStorageLimit`.
2017-09-29 12:17:52 +05:30
Kubernetes Submit Queue 1cd6a50809 Merge pull request #47640 from xiangpengzhao/fix-bin-ver
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 version info to kube-scheduler, kube-proxy and kubelet logs.

**What this PR does / why we need it**:
#46047 add such info to apiserver and CM. This adds version info to other binaries.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: related to #46047 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-09-28 20:02:59 -07:00
wackxu 2db3728fb7 use patch PodStatus to avoid overwriting potential pending status updates 2017-09-25 22:00:10 +08:00
Kubernetes Submit Queue 7c9e614cbb Merge pull request #52873 from ixdy/bazel-cleanup
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>..

bazel: build/test almost everything

**What this PR does / why we need it**: Miscellaneous cleanups and bug fixes. The main motivating idea here was to make `bazel build //...` and `bazel test //...` mostly work. (There's a few reasons these still don't work, but we're a lot closer.)

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/assign @BenTheElder @mikedanese @spxtr
2017-09-24 00:04:36 -07:00
Kubernetes Submit Queue f67e127a3b Merge pull request #52558 from jennybuckley/master
Automatic merge from submit-queue (batch tested with PRs 52831, 52764, 52763, 52673, 52558). 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 updating objects with empty pending initializers list

**What this PR does / why we need it**: When updating an object, an empty pending list should be treated as a nil initializer. This PR fixes a bug which prevented this functionality and also adds a test which will ensure this functionality is preserved.

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

**Special notes for your reviewer**:

/cc @caesarxuchao

**Release note**:

```release-note
Fixes an initializer bug where update requests which had an empty pending initializers list were erroneously rejected.
```
2017-09-23 22:57:57 -07:00
Kubernetes Submit Queue 7f3f986402 Merge pull request #52673 from p0lyn0mial/webhook_default_service_resolver
Automatic merge from submit-queue (batch tested with PRs 52831, 52764, 52763, 52673, 52558). 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>..

default service resolver for webhook admission

**What this PR does / why we need it**:
provides a default service resolver for webhook plugin. The rationale behind is that webhook plugins names can be resolved by a dns server working inside a cluster.


**Release note**:

```
NONE
```
2017-09-23 22:57:54 -07:00
Kubernetes Submit Queue 616ce0f4e7 Merge pull request #52829 from gaocegege/fix-link
Automatic merge from submit-queue (batch tested with PRs 52469, 52574, 52330, 52689, 52829). 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>..

generic_scheduler.go: Fix link in comment

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

Fix a link in generic_scheduler.go which is outdated

**Release note**:

```release-note
NONE
```

Signed-off-by: Ce Gao <ce.gao@outlook.com>
2017-09-23 21:52:57 -07:00
Kubernetes Submit Queue a5552e8da9 Merge pull request #52689 from stewart-yu/issue#07
Automatic merge from submit-queue (batch tested with PRs 52469, 52574, 52330, 52689, 52829). 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 test file

**What this PR does / why we need it**:
No test file for testutil.go

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-09-23 21:52:54 -07:00
Kubernetes Submit Queue 6e9012c94c Merge pull request #52137 from aveshagarwal/master-scheduler-resources-consolidation
Automatic merge from submit-queue (batch tested with PRs 51902, 52718, 52687, 52137, 52697). 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>..

Consolidate extended resources and hugepages in Scheduler

Fixes https://github.com/kubernetes/kubernetes/issues/51732

@bsalamat @derekwaynecarr @sjenning @kubernetes/sig-scheduling-pr-reviews
2017-09-23 19:49:54 -07:00
Kubernetes Submit Queue 507e21e7b9 Merge pull request #51889 from guangxuli/pod_affinity_error
Automatic merge from submit-queue (batch tested with PRs 52168, 48939, 51889, 52051, 50396). 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 specific errors for pod affinity predicates

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

Add specific error for pod affinity predicates

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

fix https://github.com/kubernetes/kubernetes/issues/51655

**Special notes for your reviewer**:
none
**Release note**:
none
2017-09-23 13:40:50 -07:00
Kubernetes Submit Queue 14cedb9f58 Merge pull request #51582 from jiulongzaitian/myfeature
Automatic merge from submit-queue (batch tested with PRs 43016, 50503, 51281, 51518, 51582). 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>..

change AddEventHandlerWithResyncPeriod to AddEventHandler in factory.go

Signed-off-by: zhangjie <zhangjie0619@yeah.net>



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
change AddEventHandlerWithResyncPeriod to AddEventHandler in factory.go
```
2017-09-22 23:36:02 -07:00
wackxu f9d405b49f make configFactory private 2017-09-22 17:32:54 +08:00
Kubernetes Submit Queue 04673ab614 Merge pull request #52618 from dims/deprecate-pvl-admission-controller
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>..

deprecate warning for persistent volume admission controller

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

deprecate warning for persistent volume admission controller

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

Fixes #52617

**Special notes for your reviewer**:

**Release note**:

```release-note
PersistentVolumeLabel admission controller is now deprecated.
```
2017-09-21 22:04:55 -07:00
Jeff Grafton 02fb4200dc Use buildozer to delete licenses() rules 2017-09-21 15:53:22 -07:00
Jeff Grafton 532bd482df Use buildozer to remove deprecated automanaged tags 2017-09-21 15:53:22 -07:00
Davanum Srinivas cf3fe0b5d4 deprecate warning for persistent volume admission controller 2017-09-21 14:36:29 -04:00
jennybuckley 44ec189fb0 Fixed logic with updates in initializer plugin 2017-09-21 11:06:14 -07:00
xiangpengzhao af09159419 Add version info to kube-scheduler, kube-proxy and kubelet logs. 2017-09-21 17:46:24 +08:00
Ce Gao 1a2e1f2618 generic_scheduler.go: Fix link in comment
Signed-off-by: Ce Gao <ce.gao@outlook.com>
2017-09-21 13:50:42 +08:00
p0lyn0mial 1e2c7fdd88 default service resolver for webhook admission
the rationale behind is that webhook plugins names can be resolved by a dns server working inside a cluster.
2017-09-20 17:37:11 +02:00
Kubernetes Submit Queue fb994df7e0 Merge pull request #51337 from php-coder/psp_star_in_allowed_caps
Automatic merge from submit-queue (batch tested with PRs 51337, 47080, 52646, 52635, 52666). 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>..

PodSecurityPolicy.allowedCapabilities: add support for * to allow to request any capabilities

**What this PR does / why we need it**:
Prior this change there was no way to allow to pods to request any capabilities. Cluster admin had always specify a full list of capabilities explicitly. Because there are many of them, it gets tedious. This PR makes possible to use `*` to allow all possible capabilities. Non-paranoid (and lazy) cluster admins can use it. Those who are super strict and paranoid of course won't use it because `*` allows capabilities that don't exist today but may be introduced in the future.

"privileged" PSP in examples was modified to allow privileged users to use this feature.

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

**Special notes for your reviewer**:
This functional is already present in OpenShift: https://github.com/openshift/origin/pull/12875 and https://github.com/openshift/origin/pull/15135

**Release note**:
```release-note
PSP: add support for using `*` as a value in `allowedCapabilities` to allow to request any capabilities
```

CC @simo5 @pweil- @gyliu513 @liqlin2015
2017-09-19 17:31:04 -07:00
stewart-yu 11722094c2 Add test file for go file 2017-09-19 12:28:36 +08:00
Hemant Kumar 780c531e86 Resize plugin should only check for increase in size
We should only check if user is trying to increase the volume.
2017-09-18 14:36:14 -04:00
Jordan Liggitt 83b71b6dfe
Add pod disruption budgets to admin/edit/view roles 2017-09-18 10:15:24 -04:00
Avesh Agarwal ae05a6da34 Consolidate extended resources and hugepages in Scheduler. 2017-09-18 09:32:16 -04:00
Solly Ross 8cbbbac27d Add bootstrap policy for HPA metrics REST clients
Since we weren't running the HPA with metrics REST clients by default,
we had no bootstrap policy enabling the HPA controller to talk to the
metrics APIs.

This adds permissions for the HPA controller to talk list
pods.metrics.k8s.io, and list any resource in custom.metrics.k8s.io.
2017-09-15 17:27:38 -04:00
Harry Zhang 2afab02349 Use NC to fix deprecated taint key name 2017-09-15 23:54:15 +08:00
Kubernetes Submit Queue 9aef242a4c Merge pull request #52223 from bsalamat/approver
Automatic merge from submit-queue (batch tested with PRs 51796, 52223)

Add bsalamat to sig-scheduling-maintainers

**What this PR does / why we need it**:
Adds bsalamat to sig-scheduling-maintainers.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # N/A

**Release note**:

```release-note
NONE
```

@kubernetes/sig-scheduling-pr-reviews @davidopp @timothysc @k82cn @wojtek-t
2017-09-15 05:51:23 -07:00
Kubernetes Submit Queue 935726f109 Merge pull request #52452 from gnufied/fix-quota-on-update
Automatic merge from submit-queue (batch tested with PRs 52452, 52115, 52260, 52290)

Fix support for updating quota on update

This PR implements support for properly handling quota when resources are updated. We never take negative values and add them up.

Fixes https://github.com/kubernetes/kubernetes/issues/51736 

cc @derekwaynecarr 

/sig storage

```release-note
Make sure that resources being updated are handled correctly by Quota system
```
2017-09-15 01:59:56 -07:00
Kubernetes Submit Queue 7181dd4946 Merge pull request #50476 from caesarxuchao/plumb-proxy
Automatic merge from submit-queue (batch tested with PRs 51824, 50476, 52451, 52009, 52237)

Plumbing the proxy dialer to the webhook admission plugin

* Fixing https://github.com/kubernetes/kubernetes/issues/49987. Plumb the `Dial` function to the `transport.Config`
* Fixing https://github.com/kubernetes/kubernetes/issues/52366. Let the webhook admission plugin sets the `TLSConfg.ServerName`.

I tested it in my gke setup. I don't have time to implement an e2e test before 1.8 release. I think it's ok to add the test later, because *i)* the change only affects the alpha webhook admission feature, and *ii)* the webhook feature is unusable without the fix. That said, it's up to my reviewer to decide.

Filed https://github.com/kubernetes/kubernetes/issues/52368 for the missing e2e test.

( The second commit is https://github.com/kubernetes/kubernetes/pull/52372, which is just a cleanup of client configuration in e2e tests. It removed a function that marshalled the client config to json and then unmarshalled it. It is a prerequisite of this PR, because this PR added the `Dial` function to the config which is not json marshallable.)

```release-note
Fixed the webhook admission plugin so that it works even if the apiserver and the nodes are in two networks (e.g., in GKE).
Fixed the webhook admission plugin so that webhook author could use the DNS name of the service as the CommonName when generating the server cert for the webhook.

Action required:
Anyone who generated server cert for admission webhooks need to regenerate the cert. Previously, when generating server cert for the admission webhook, the CN value doesn't matter. Now you must set it to the DNS name of the webhook service, i.e., `<service.Name>.<service.Namespace>.svc`.
```
2017-09-15 01:08:01 -07:00
Kubernetes Submit Queue 1646db0ba7 Merge pull request #52247 from wackxu/atd
Automatic merge from submit-queue (batch tested with PRs 52442, 52247, 46542, 52363, 51781)

Add some test case in default_test.go

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

Add some test case in default_test.go

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


**Release note**:

```release-note
NONE
```
2017-09-15 00:11:08 -07:00
Harry Zhang 221db2bd6b Refactor node taint conditions 2017-09-15 14:34:11 +08:00
Chao Xu 856a1db57a fix the webhook unit test; the server cert needs to have a valid CN;
fix a fuzzer;
2017-09-14 15:36:25 -07:00
Chao Xu 186a0684d5 plumb the proxyTransport to the webhook admission plugin;
set the ServerName in the config for webhook admission plugin.
2017-09-14 15:35:12 -07:00
Hemant Kumar 066fcf785e Implement support for updating resources 2017-09-13 21:05:44 -04:00
Gavin a724a0fcdc Add specific errors for pod affinity predicates 2017-09-13 23:47:58 +08:00
Kubernetes Submit Queue 83b4c0ac84 Merge pull request #48226 from wongma7/pd-predicate-log
Automatic merge from submit-queue (batch tested with PRs 48226, 52046, 52231, 52344, 52352)

Log get PVC/PV errors in MaxPD predicate only at high verbosity

The error is effectively ignored since even if a PVC/PV doesn't exist it gets counted, and it's rarely actionable either so let's reduce the verbosity.

Basically a user somewhere on the cluster will have to have done something "wrong" for this error to occur, e.g. if *,while the pod is running, pod's PVC is deleted or pods' PVC's PV is deleted. And from that point forward the logs will be spammed every time the predicate is evaluated on a node where that "wrong" pod exists

**Release note**:

```release-note
NONE
```
2017-09-12 19:39:52 -07:00
Kubernetes Submit Queue 0ae98b6ffe Merge pull request #52146 from resouer/eclass-fix
Automatic merge from submit-queue

Note equivalence class for dev and other fix

**What this PR does / why we need it**:
1. Add a note for predicate developers to respect equivalence class design
2. Add comments and re-ordered the related data structure, ref https://github.com/kubernetes/community/pull/1031
3. Fix some nits (typo, code length etc)


**Special notes for your reviewer**:

**Release note**:

```release-note
Scheduler predicate developer should respect equivalence class cache
```
2017-09-12 04:36:10 -07:00
Bobby (Babak) Salamat e38d4a0a8f Add bsalamat to sig-scheduling-maintainers 2017-09-11 11:10:57 -07:00
gmarek b152d08ba4 fix condition-taint labels 2017-09-11 10:19:51 +02:00
wackxu ec058b14f0 add some test case 2017-09-10 20:31:53 +08:00
Harry Zhang 71babd1496 Note equivalence class for dev and other fix 2017-09-09 22:35:16 +08:00
Kubernetes Submit Queue f695a3120a Merge pull request #50949 from bsalamat/preemption_eviction
Automatic merge from submit-queue

Add pod preemption to the scheduler

**What this PR does / why we need it**:
This is the last of a series of PRs to add priority-based preemption to the scheduler. This PR connects the preemption logic to the scheduler workflow.

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

**Special notes for your reviewer**:
This PR includes other PRs which are under review (#50805, #50405, #50190). All the new code is located in 43627afdf9.

**Release note**:

```release-note
Add priority-based preemption to the scheduler.
```

ref/ #47604

/assign @davidopp 

@kubernetes/sig-scheduling-pr-reviews
2017-09-08 14:19:42 -07:00
wackxu f05d4b7f1c add test case 2017-09-08 15:07:13 +08:00
Bobby (Babak) Salamat c0b718373b Fix RBAC rules to allow scheduler update annotations of pods. 2017-09-07 15:31:55 -07:00
Bobby (Babak) Salamat 86b06c3832 autogenerated files 2017-09-07 15:31:55 -07:00
Bobby (Babak) Salamat 4a08dff168 Add pod eviction logic for scheduler preemption
Add Preempt to scheduler interface
Add preemption to the scheduling workflow
Minor changes to the scheduler integration test library
2017-09-07 15:31:55 -07:00
Kubernetes Submit Queue 0ed05f2d08 Merge pull request #49133 from deads2k/gc-02-permissions
Automatic merge from submit-queue (batch tested with PRs 49133, 51557, 51749, 50842, 52018)

add controller permissions to set blockOwnerDeletion

fixes https://github.com/kubernetes/kubernetes/issues/51970

`blockOwnerDeletion` requires delete permissions on the owner object.  This adds that permission for our controllers.

@kubernetes/sig-auth-misc 

```release-note
The OwnerReferencesPermissionEnforcement admission plugin now requires `update` permission on the `finalizers` subresource of the referenced owner in order to set `blockOwnerDeletion` on an owner reference.
```
2017-09-06 13:36:04 -07:00
Slava Semushin 9015a82692 PodSecurityPolicy.allowedCapabilities: add support for using * to allow to request any capabilities.
Also modify "privileged" PSP to use it and allow privileged users to use
any capabilities.
2017-09-06 12:18:09 +02:00
David Eads 2572ea50e0 add permissions to workload controllers to block owners 2017-09-05 13:47:49 -04:00
David Eads 6d040812f0 check block owner ref on finalizers subresource 2017-09-05 11:29:52 -04:00
Derek Carr 41a4e2ccad Scheduler support for hugepages 2017-09-05 09:46:08 -04:00
saadali 3b834cf665 Modify VolumeZonePredicate to handle multi-zone PV
Modifies the VolumeZonePredicate to handle a PV that belongs to more
then one zone or region. This is indicated by the zone or region label
value containing a comma separated list.
2017-09-04 20:13:32 -07:00
Hemant Kumar 84029c2c1a Update generated files - api, bazel, json
Update all generated files json, protocolbuffers,
documentation
2017-09-04 09:02:35 +02:00
Hemant Kumar 530ae4b3b5 Add rbac policy change for expand controller 2017-09-04 09:02:34 +02:00
Hemant Kumar e78d433150 Implement necessary API changes
Introduce feature gate for expanding PVs
Add a field to SC
Add new Conditions and feature tag pvc update
Add tests for size update via feature gate
register the resize admission plugin
Update golint failures
2017-09-04 09:02:34 +02:00
Kubernetes Submit Queue a4ff702a13 Merge pull request #51818 from liggitt/controller-roles
Automatic merge from submit-queue (batch tested with PRs 51819, 51706, 51761, 51818, 51500)

Build controller roles/bindings on demand

As we start to have alpha gated features that involve policy changes, we need to conditionally include roles/bindings in policy based on feature enablement.

Examples:
 * https://github.com/kubernetes/kubernetes/pull/49727/files#diff-a066255fca075e2bdcfe045e7ca352f7
 * https://github.com/kubernetes/kubernetes/pull/51202/files#diff-eee450e334a11e0b683ce965f584c3c4R137

This moves the policy building from an init() func to be on demand, so that feature gates set at the point we set up the post-start reconcile take effect
2017-09-03 15:00:11 -07:00
Kubernetes Submit Queue 4d42f80382 Merge pull request #50925 from staebler/server-event-rate-limiter
Automatic merge from submit-queue (batch tested with PRs 51805, 51725, 50925, 51474, 51638)

Limit events accepted by API Server

**What this PR does / why we need it**:
This PR adds the ability to limit events processed by an API server. Limits can be set globally on a server, per-namespace, per-user, and per-source+object. This is needed to prevent badly-configured or misbehaving players from making a cluster unstable.

Please see https://github.com/kubernetes/community/pull/945.

**Release Note:**
```release-note
Adds a new alpha EventRateLimit admission control that is used to limit the number of event queries that are accepted by the API Server.
```
2017-09-03 11:10:03 -07:00
Kubernetes Submit Queue c84b3132a2 Merge pull request #48051 from xilabao/add-selfsubjectrulesreview-api
Automatic merge from submit-queue (batch tested with PRs 45724, 48051, 46444, 51056, 51605)

Add selfsubjectrulesreview in authorization

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

**Which issue this PR fixes**: fixes #47834 #31292

**Special notes for your reviewer**:

**Release note**:

```release-note
Add selfsubjectrulesreview API for allowing users to query which permissions they have in a given namespace.
```
/cc @deads2k @liggitt
2017-09-02 12:11:04 -07:00
Kubernetes Submit Queue 73326ef01d Merge pull request #51523 from stewart-yu/feature
Automatic merge from submit-queue (batch tested with PRs 50381, 51307, 49645, 50995, 51523)

Update defaults.go

**What this PR does / why we need it**:
This PR is a TODO
Add explain about TaintTolerationPriority function.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-09-01 16:34:08 -07:00
Jordan Liggitt b7fe9ff18a
Build controller roles/bindings on demand 2017-09-01 15:18:13 -04:00
staebler a4542ae528 Create an EventRateLimit admission control plug-in for the API Server.
The EventRateLimit plug-in limits the number of events that the API Server
will accept in a given time period. It allows for server-wide, per-namespace,
per-user,and per-source+object rate limiting.
2017-09-01 13:38:03 -04:00
Kubernetes Submit Queue 6f86c9cf66 Merge pull request #51632 from sakeven/fix_info_msg
Automatic merge from submit-queue (batch tested with PRs 51632, 51055, 51676, 51560, 50007)

[Scheduler] Fix typo in info message

Signed-off-by: sakeven <jc5930@sina.cn>



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

Missed a `'` in info message.

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

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
2017-09-01 08:27:10 -07:00
xilabao f14c138438 add selfsubjectrulesreview api 2017-09-01 19:09:43 +08:00
Stewart-YU f27bc9444d Add explain for register TaintTolerationPriority function. 2017-09-01 14:21:58 +08:00
Kubernetes Submit Queue 1d0d3db2bc Merge pull request #51534 from deads2k/scheduler-01-dont-panic
Automatic merge from submit-queue (batch tested with PRs 51574, 51534, 49257, 44680, 48836)

update scheduler to return structured errors instead of process exit

The scheduler Run method returns an error that is properly handled at higher levels.  Instead of existing the process, we should return the error and handle it at higher level logic to allow testing of error conditions and composition of commands.  The changes are relatively minor.

@sjenning @aveshagarwal
2017-08-31 23:13:18 -07:00
Kubernetes Submit Queue a8a505b767 Merge pull request #49616 from sakeven/feature/found_HashEquivalencePod
Automatic merge from submit-queue (batch tested with PRs 51480, 49616, 50123, 50846, 50404)

getHashEquivalencePod should return if equivalence pod is found

Signed-off-by: sakeven <jc5930@sina.cn>



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

getHashEquivalencePod should return if equivalence pod is found, rather than simply check equivalenceHash equals to 0 later.

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

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
2017-08-31 20:08:37 -07:00
Kubernetes Submit Queue 8679a8f5fe Merge pull request #50163 from jingxu97/Aug/sizeLimit
Automatic merge from submit-queue (batch tested with PRs 51707, 51662, 51723, 50163, 51633)

Change SizeLimit to a pointer

This PR fixes issue #50121

```release-note
The `emptyDir.sizeLimit` field is now correctly omitted from API requests and responses when unset.
```
2017-08-31 18:43:38 -07:00
Kubernetes Submit Queue 374e631626 Merge pull request #50757 from NickrenREN/local-storage-limitrange
Automatic merge from submit-queue

Add local ephemeral storage support in LimitRange

**Special notes for your reviewer**:
For a single local ephemeral storage resource

xref #43607 

**Release note**:
```release-note
Add local ephemeral storage support to LimitRange
```

/assign @jingxu97 
cc @ddysher
2017-08-30 13:12:23 -07:00
Jing Xu 4d6da1fd9a Change SizeLimit to a pointer
This PR fixes issue #50121
2017-08-30 11:50:35 -07:00
Bobby (Babak) Salamat 1cec8bac9c Add the logic to pick one node for preemption 2017-08-30 10:47:21 -07:00
Bobby (Babak) Salamat 2c63705e09 autogenerated files 2017-08-30 10:32:09 -07:00
Bobby (Babak) Salamat 20931d7a68 Add specific types for PredicateMetadata and PredicateMetadataProducer 2017-08-30 10:32:09 -07:00
Bobby (Babak) Salamat a4edc6c871 Add preemption victim selector logic to scheduler 2017-08-30 10:32:09 -07:00
sakeven 36a218e0ce [Scheduler] Fix typo in info message
Signed-off-by: sakeven <jc5930@sina.cn>
2017-08-30 22:29:15 +08:00
Kubernetes Submit Queue 0596891e42 Merge pull request #51585 from sakeven/regroup-packages
Automatic merge from submit-queue (batch tested with PRs 51439, 51361, 51140, 51539, 51585)

[Scheduler] regroup imports

Signed-off-by: sakeven <jc5930@sina.cn>



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

>Imports are organized in groups, with blank lines between them. The standard library packages are always in the first group.

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

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
2017-08-30 03:59:37 -07:00
Kubernetes Submit Queue f25e34c12f Merge pull request #51535 from deads2k/scheduler-02-no-http
Automatic merge from submit-queue (batch tested with PRs 47054, 50398, 51541, 51535, 51545)

allow disabling the scheduler port

Unlike the `kube-apiserver`, the scheduler can function without exposing a status port.  This provides the option to disable it by explicitly passing a `-1`.  This does not change default behavior.

@aveshagarwal
2017-08-30 01:51:35 -07:00
Kubernetes Submit Queue c7c0387d57 Merge pull request #51541 from sttts/sttts-deepcopy-scheduler
Automatic merge from submit-queue (batch tested with PRs 47054, 50398, 51541, 51535, 51545)

scheduler: simplify deepcopy calls

Pre-requisite of https://github.com/kubernetes/kubernetes/pull/49575.
2017-08-30 01:51:32 -07:00
Kubernetes Submit Queue 5030391c07 Merge pull request #51543 from sttts/sttts-deepcopy-admission
Automatic merge from submit-queue (batch tested with PRs 51228, 50185, 50940, 51544, 51543)

admission plugins: simplify deepcopy calls
2017-08-29 23:54:34 -07:00
Kubernetes Submit Queue c4a0f9385b Merge pull request #50185 from k82cn/k8s_42001-3
Automatic merge from submit-queue (batch tested with PRs 51228, 50185, 50940, 51544, 51543)

Task 4: Ignored node condition predicates if TaintsByCondition enabled.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: part of #42001 

**Release note**:
```release-note
None
```
2017-08-29 23:54:27 -07:00
sakeven 0420c8f048 [Scheduler] regroup packages
Signed-off-by: sakeven <jc5930@sina.cn>
2017-08-30 11:14:44 +08:00
zhangjie 301d41cac8 change AddEventHandlerWithResyncPeriod to AddEventHandler in factory.go
Signed-off-by: zhangjie <zhangjie0619@yeah.net>
2017-08-30 10:18:00 +08:00
Dr. Stefan Schimanski 42b40ddc0f admission plugins: simplify deepcopy calls 2017-08-29 20:01:08 +02:00
Dr. Stefan Schimanski 555cabacf3 scheduler: simplify deepcopy calls 2017-08-29 19:54:57 +02:00
David Eads 61de1ba986 allow disabling the scheduler port 2017-08-29 11:43:27 -04:00
Klaus Ma b5094dd877 Ignored node condition predicates if TaintsByCondition enabled. 2017-08-29 23:21:32 +08:00
David Eads 539fc6ec95 update scheduler to return structured errors instead of process exit 2017-08-29 11:20:06 -04:00
Kubernetes Submit Queue 12d73c31a9 Merge pull request #51436 from liggitt/initializer-feature
Automatic merge from submit-queue (batch tested with PRs 51471, 50561, 50435, 51473, 51436)

Feature gate initializers field

The metadata.initializers field should be feature gated and disabled by default while in alpha, especially since enforcement of initializer permission that keeps users from submitting objects with their own initializers specified is done via an admission plugin most clusters do not enable yet.

Not gating the field and tests caused tests added in https://github.com/kubernetes/kubernetes/issues/51429 to fail on clusters that don't enable the admission plugin.

This PR:
* adds an `Initializers` feature gate, auto-enables the feature gate if the admission plugin is enabled
* clears the `metadata.initializers` field of objects on create/update if the feature gate is not set
* marks the e2e tests as feature-dependent (will follow up with PR to test-infra to enable the feature and opt in for GCE e2e tests)

```release-note
Use of the alpha initializers feature now requires enabling the `Initializers` feature gate. This feature gate is auto-enabled if the `Initialzers` admission plugin is enabled.
```
2017-08-29 02:22:19 -07:00
Jordan Liggitt 658956f063
Feature gate initializers field 2017-08-28 11:11:48 -04:00
Kubernetes Submit Queue 4ba2b625c5 Merge pull request #50805 from bsalamat/preemption_metacompute
Automatic merge from submit-queue

Add support to modify precomputed predicate metadata upon adding/removal of a pod

**What this PR does / why we need it**: This PR adds capability to change precomputed predicate metadata and let's us add/remove pods to the precomputed metadata efficiently without the need ot recomputing everything upon addition/removal of pods. This PR is needed as a part of adding preemption logic to the scheduler.

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

**Special notes for your reviewer**:
To make the review process a bit easier, there are three commits. The cleanup commit is only moving code and renaming some functions, without logic changes.

**Release note**:

```release-note
NONE
```
ref/ #47604
ref/ #48646

/assign @wojtek-t 

@kubernetes/sig-scheduling-pr-reviews @davidopp
2017-08-28 05:11:19 -07:00
Cao Shufeng 83157370a1 remove useless allocation of map
This one-element map is only used for checking api. Remove it and
simplify the code.
2017-08-28 17:36:19 +08:00
Kubernetes Submit Queue daf591c193 Merge pull request #51117 from k82cn/k8s_50360_2
Automatic merge from submit-queue

Moved node condition filter into a predicates.

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

**Release note**:

```release-note
A new predicates, named 'CheckNodeCondition', was added to replace node condition filter. 'NetworkUnavailable', 'OutOfDisk' and 'NotReady' maybe reported as a reason when failed to schedule pods.
```
2017-08-28 01:22:27 -07:00
lichuqiang d59368906a fix bug in admission test 2017-08-28 16:18:50 +08:00
Bobby (Babak) Salamat 87d406569d bazel update 2017-08-28 00:12:46 -07:00
Bobby (Babak) Salamat 264ca7d158 Add support to recompute partial predicate metadata upon adding/removing pods 2017-08-28 00:12:46 -07:00
Kubernetes Submit Queue 915b772f9b Merge pull request #50933 from mattmoyer/bootstrap-token-groups
Automatic merge from submit-queue (batch tested with PRs 49861, 50933, 51380, 50688, 51305)

Add configurable groups to bootstrap tokens.

**What this PR does / why we need it**:
This change adds support for authenticating bootstrap tokens into a configurable set of extra groups in addition to `system:bootstrappers`. Previously, bootstrap tokens could only ever authenticate to the `system:bootstrappers` group.

Groups are specified as a comma-separated list in the `auth-extra-groups` key of the `bootstrap.kubernetes.io/token` Secret, and must begin with the prefix `system:bootstrapper:` (and match a validation regex that checks against our normal convention). Whether or not any extra groups are configured, `system:bootstrappers` will still be added.

This also adds a `--groups` flag for `kubeadm token create`, which sets the `auth-extra-groups` key on the resulting Secret. The default is to not set the key.

`kubeadm token list` is also updated to include a `EXTRA GROUPS` output column.

**Which issue this PR fixes**: fixes #49306

**Special notes for your reviewer**: 
The use case for this is in https://github.com/kubernetes/kubernetes/issues/49306. Comments on the feature itself are probably better over there. It will be part of how HA/self-hosting kubeadm bootstraps new master nodes (post 1.8).

**Release note**:
```release-note
Add support for configurable groups for bootstrap token authentication.
```

cc @luxas @kubernetes/sig-cluster-lifecycle-api-reviews @kubernetes/sig-auth-api-reviews 

/kind feature
2017-08-27 22:20:48 -07:00
Kubernetes Submit Queue 877ee91930 Merge pull request #51082 from caesarxuchao/repair-null-pending-initializer
Automatic merge from submit-queue (batch tested with PRs 50953, 51082)

Fix mergekey of initializers; Repair invalid update of initializers

Fix https://github.com/kubernetes/kubernetes/issues/51131

The PR did two things to make parallel patching `metadata.initializers.pending` possible:
* Add mergekey to initializers.pending
* Let the initializer admission plugin set the `metadata.intializers` to nil if an update makes the `pending` and the `result` both nil, instead of returning a validation error. Otherwise if multiple initializer controllers sending the patch removing themselves from `pending` at the same time, one of them will get a validation error.


```release-note
The patch to remove the last initializer from metadata.initializer.pending will result in metadata.initializer to be set to nil (assuming metadata.initializer.result is also nil), instead of resulting in an validation error.
```
2017-08-26 23:03:01 -07:00
Kubernetes Submit Queue 217513e27a Merge pull request #45294 from liggitt/proto-slices
Automatic merge from submit-queue

Remove null -> [] slice hack

Closes #44593

When 1.6 added protobuf storage, the storage layer lost the ability to persist slice fields with empty but non-null values.

As a workaround, we tried to convert empty slice fields to `[]`, rather than `null`. Compressing `null` -> `[]` was just as much of an API breakage as `[]` -> `null`, but was hoped to cause fewer problems in clients that don't do null checks.

Because of conversion optimizations around converting lists of objects, the `null` -> `[]` hack was discovered to only apply to individual get requests, not to a list of objects. 1.6 and 1.7 was released with this behavior, and the world didn't explode. 1.7 documented the breaking API change that `null` and `[]` should be considered equivalent, unless otherwise noted on a particular field.

This PR:

* Reverts the earlier attempt (https://github.com/kubernetes/kubernetes/pull/43422) at ensuring non-null json slice output in conversion
* Makes results of `get` consistent with the results of `list` (which helps naive clients that do deepequal comparisons of objects obtained via list/watch and get), and allows empty slice fields to be returned as `null`

```release-note
Protobuf serialization does not distinguish between `[]` and `null`.
API fields previously capable of storing and returning either `[]` and `null` via JSON API requests (for example, the Endpoints `subsets` field) can now store only `null` when created using the protobuf content-type or stored in etcd using protobuf serialization (the default in 1.6+). JSON API clients should tolerate `null` values for such fields, and treat `null` and `[]` as equivalent in meaning unless specifically documented otherwise for a particular field.
```
2017-08-26 13:35:29 -07:00
Justin Santa Barbara bc66c6187c Fix NodeIdentifier godocs: IdentifyNode -> NodeIdentity
The godocs had an older name for the NodeIdentity function.
2017-08-26 15:56:33 -04:00