Commit Graph

15599 Commits (5f4c8c241e799cc7aec86c34fe02fd213113f91f)

Author SHA1 Message Date
Kubernetes Submit Queue e02b73ff67 Merge pull request #33464 from liggitt/terminating-namespace-check
Automatic merge from submit-queue

Fix cache expiration check

The check for whether an entry in the `forceLiveLookup` cache had expired was backwards. Fixed the logic and added tests
2016-09-26 21:51:34 -07:00
Kubernetes Submit Queue 6c1c0b9842 Merge pull request #32027 from m1093782566/m109-petset-fix-test-err
Automatic merge from submit-queue

[BUG FIX] Fix bug of UT in Pet Set

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

Fix bug of UT in Pet Set.

[1] https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/pet_set_test.go#L74-L75, 

I think` len(pl)` is not equal to `len(fc.pets)`, see [here](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/fakes.go#L229-L233)

[2] https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/fakes.go#L249

I think should change to 

```
if len(f.pets) <= index {
```

because when `len(f.pets)==index`, then [here](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/fakes.go#L252-L254) will cause `index out of range` panic!

[3] https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/fakes.go#L271

same reason with [2]

[4] https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/pet_set_test.go#L79

which doesn't make use of the error returned by [setHealthy](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/petset/fakes.go#L248) and has a risk of letting the error out.

Should we catch the error and use `t.Errorf()` to stop the test?
2016-09-26 21:13:14 -07:00
guangxuli f2f591aa45 test file should be remove after test over
remove the tmp file

gofmt
2016-09-27 11:56:45 +08:00
Tim Hockin 957c85a8fd Add a lower-bound for conntrack 2016-09-26 20:25:40 -07:00
Tim Hockin 38d7c4b271 Conversion: log opted-out fields 2016-09-26 20:07:54 -07:00
Tim Hockin 7efb2d4738 Always emit autoConvert funcs, but call for help
Previously we refused to emit 'autoConvert_*' functions if any field was not
convertible.  The way around this was to write manual Conversion functions, but
to do so safely you must handle every fields.  Huge opportunity for errors.

This PR cleans up the filtering such that it only operates on types that should
be converted (remove a lot of code) and tracks when fields are skipped.  In
that case, it emits an 'autoConvert' function but not a public 'Convert'
function.  If there is no manual function, the compile will fail.

This also means that manual conversion functions can call autoConvert functions
and then "patch up" what they need.
2016-09-26 20:07:54 -07:00
Kubernetes Submit Queue abcc7927d1 Merge pull request #33208 from hacktastic/fix_openstack_lbaas_healthmonitors
Automatic merge from submit-queue

Fixed a bug that causes k8s to delete all healthmonitors on your OpenStack tenant

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:
The OpenStack LBaaS v2 api does not support filtering health monitors by pool_id, so /lbaas/healthmonitors?pool_id=abc123 will always return all health monitors in your OpenStack tenant. 

This presents a problem when, in the very next block of code, we loop over the list of monitorIDs and delete them one-by-one. This will delete all the health monitors in your tenant without warning. 

Fortunately, we already got the healthmonitor IDs when we built the list of pools. Using those, we can delete only those healthmonitors associated with our pool(s).

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

**Special notes for your reviewer**:
The main issue here was the use of v2_monitors.List(lbaas.network, v2_monitors.ListOpts{PoolID: poolID}). This is trying to filter healthmonitors by pool_id, but that is not supported by the API. It creates a call like /lbaas/healthmonitors?pool_id=abc123. The API server ignores the pool_id parameter and returns a list of all healthmonitors (which k8s then tries to delete).

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-09-26 18:42:18 -07:00
Kubernetes Submit Queue 35e9f4d07f Merge pull request #31235 from ping035627/ping035627-patch-0823-1
Automatic merge from submit-queue

Implement replace with a call to testapi.Codec()

Implement replace with a call to testapi.Codec().
2016-09-26 18:02:49 -07:00
Kubernetes Submit Queue 9a899b92ae Merge pull request #29605 from lojies/addportvalidate
Automatic merge from submit-queue

add port validate when --port is set or --expose=true

```shell
$ kubectl run nginx --image=nginx --port=88888 --expose=true
The Deployment "nginx" is invalid.
spec.template.spec.containers[0].ports[0].containerPort: Invalid value: 88888: must be between 1 and 65535, inclusive
$ kubectl run nginx --image=nginx --port=0 --expose=true
error: --port must be a positive integer when exposing a service
```

1. when port is greater than 65535, port is required between 1 and 65535 and deployment 'nginx' can not be created.
2. when port is less than 1, port is not validated and deployment 'nginx' can be created. But service will be created failed.

so i add this change:
when --port is set or --expose=true, validate port range so that error reported can be the same when port is greater than 65535 or less than 1.
And this can also find the port  range error before creating the deployment other than during creating the deployment.
2016-09-26 17:25:30 -07:00
Chao Xu 7249c9bd8a fix TestCreateWithNonExistentOwner
remove the use of gc.QueuesDrained
2016-09-26 16:51:56 -07:00
Kubernetes Submit Queue ea688f5e44 Merge pull request #31276 from juanvallejo/jvallejo_update-dry-run-create
Automatic merge from submit-queue

Update kubectl create message when using --dry-run

`kubectl create <resource> <name> --dry-run` provides a misleading success
message.

When commands such as `kubectl new-app node` are run with a
`--dry-run` flag, they make this clear by appending a "(DRY RUN)"
string to the final output. `kubectl create <resource>  <name> --dry-run`
does not do this, providing a potentially misleading output.

This patch appends a "(DRY RUN)" string to the end of a successful
message of `kubectl create` subcommands that support the `--dry-run` flag.

`kubectl create quota quota --dry-run`
```
resourcequota "quota" created
```

`kubectl create quota quota --dry-run`
```
resourcequota "quota" created (DRY RUN)
```

**Release note**:
```release-note
release-note-none
```
2016-09-26 16:01:17 -07:00
Chao Xu a397e306a4 run client-gen
run copy.sh
2016-09-26 15:40:36 -07:00
Chao Xu e17e0b19ab remove special clientrepo code from main repository gcp plugin
rename plugin/pkg/client/auth/plugins.go package name to auth

add the plugin import line in client-gen

update import_known_versions for release_1_5 clientset

change copy.sh
2016-09-26 15:40:29 -07:00
Kubernetes Submit Queue f429d8f082 Merge pull request #33509 from ivan4th/fix-daemon-set-namespace-handling-for-predicates
Automatic merge from submit-queue

Fix DaemonSet namespace handling for predicates

In order to determine whether a node should run its daemon pod,
DaemonController creates a dummy pod based on DaemonSet's template and
then uses scheduler predicates (currently GeneralPredicates) to test
whether such pod can be run by the node. The problem was that
DaemonController was not setting Namespace for the dummy pod. This was
not affecting currently used GeneralPredicates but this problem could
bite later when some namespace-dependent predicates are added to
GeneralPredicates or directly to DaemonController's node checks
(e.g. pod affinity).

Stumbled upon it while working on e2e test for #31136
2016-09-26 15:21:22 -07:00
Jordan Liggitt 5599ca3be5
Decorate authenticated users with system:authenticated group 2016-09-26 17:19:00 -04:00
Jordan Liggitt 0c36c5e556
Add anonymous auth to the auth chain 2016-09-26 17:19:00 -04:00
Jordan Liggitt 0f3baaad50
Create GroupAdder authenticator wrapper 2016-09-26 17:18:05 -04:00
Paul Morie b1f91bd510 Move Kubelet pod-management code into kubelet_pods.go 2016-09-26 17:16:59 -04:00
Kubernetes Submit Queue 987aef1f64 Merge pull request #31190 from hongchaodeng/r2
Automatic merge from submit-queue

Pass SelectionPredicate instead of Filter to storage layer

Depends on #31189 (first commit).

ref: #29888

What?
This PR removes the filtering logic and passes SelectionPredicate to storage layer.

Why?
Filter doesn't provide enough information of and isn't the right abstraction for indexing. We need to pass in SelectionPredicate instead.
2016-09-26 14:09:10 -07:00
Kubernetes Submit Queue 3efed287b4 Merge pull request #32231 from timothysc/re-re-http2
Automatic merge from submit-queue

Default HTTP2 on, post fixes from #29001

This reverts commit 8cb799c789.

Enables HTTP2 on by default post fixes from https://github.com/kubernetes/kubernetes/issues/29001 for 1.5 

NOTE:  We are nearing lb connection limits at current thresholds. 

/cc @bradfitz @lavalamp @smarterclayton
2016-09-26 13:26:46 -07:00
Clayton Coleman 9bfa63dbba
Unwrap aggregates of size 1 when writing errors
Also, only use aggregate in get when we actually are dealing with
multiple errors.
2016-09-26 15:56:38 -04:00
Ivan Shvedunov 5651f822fd Fix DaemonSet namespace handling for predicates
In order to determine whether a node should run its daemon pod,
DaemonController creates a dummy pod based on DaemonSet's template and
then uses scheduler predicates (currently GeneralPredicates) to test
whether such pod can be run by the node. The problem was that
DaemonController was not setting Namespace for the dummy pod. This was
not affecting currently used GeneralPredicates but this problem could
bite later when some namespace-dependent predicates are added to
GeneralPredicates or directly to DaemonController's node checks
(e.g. pod affinity).

Stumbled upon it while working on e2e test for #31136
2016-09-26 22:14:28 +03:00
Kubernetes Submit Queue 273f02c8b2 Merge pull request #33448 from Random-Liu/fix-dockershim-unit-test-flake
Automatic merge from submit-queue

Use fakeclock correctly in dockershim unit test.

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

/cc @feiskyer @yujuhong
2016-09-26 11:59:11 -07:00
Phillip Wittrock 0e22d072a3 Update CHANGELOG.md for v1.4.0. 2016-09-26 11:48:00 -07:00
Random-Liu 2141e230a6 Add oom score adj in new CRI implementation. 2016-09-26 11:39:02 -07:00
Kubernetes Submit Queue 19a2a10354 Merge pull request #33389 from Random-Liu/lifecycle-hook
Automatic merge from submit-queue

CRI: Fix lifecycle hook and add container lifecycle node e2e test

This PR:
1) Adds pod spec missing handling in kuberuntime. (1st commit)
2) Adds container lifecycle hook node e2e test. (2nd commit)

@yujuhong @feiskyer
2016-09-26 10:48:35 -07:00
Hongchao Deng 6f3ac807fd pass SelectionPredicate instead of Filter to storage layer 2016-09-26 09:47:19 -07:00
Michail Kargakis 0a843a50ba controller: don't retry deployments with overlapping selectors
Returning an error will cause the deployment to be requeued. We should
just emit an event for deployments with overlapping selectors and silently
drop then out of the queue. This should be transitioned to a Condition
once we have them.
2016-09-26 17:59:51 +02:00
Timothy St. Clair 009f87719b Fix server initialization for http2 and go 1.7 2016-09-26 10:28:18 -05:00
Kubernetes Submit Queue 2750c778d4 Merge pull request #33294 from deads2k/rbac-08-compact-init
Automatic merge from submit-queue

start creating controller SA roles.  start with just one

This creates a clusterrole for the replicationcontroller controller.  It also streamlines the rule creation code and I'll use this role as practice for wiring up RBAC rules.

@kubernetes/sig-auth 
@ericchiang Jordan is ooto, mind taking a look?
2016-09-26 08:14:01 -07:00
Timothy St. Clair d5e3832bc0 Revert "Revert "Follow on for 1.4 to default HTTP2 on by default""
This reverts commit 8cb799c789.
2016-09-26 10:09:26 -05:00
Kubernetes Submit Queue 69083bcfce Merge pull request #33281 from deads2k/client-12-simplify-adapter
Automatic merge from submit-queue

remove the clientset adapter

This removes the clientset adapter entirely.  There is one focused adapter that remains in a single e2e test.  Every other reference was removed.
2016-09-26 07:35:08 -07:00
Jordan Liggitt 6cb0db2651
Allow testing LRUExpireCache with fake clock 2016-09-26 10:16:08 -04:00
Kubernetes Submit Queue eed1e02346 Merge pull request #33012 from wojtek-t/informer_in_route_controller
Automatic merge from submit-queue

Use Informer framework in route controller
2016-09-26 06:56:06 -07:00
deads2k b330b0a220 start creating controller SA roles. start with just one 2016-09-26 09:31:36 -04:00
Kubernetes Submit Queue 4219d9584b Merge pull request #33384 from deads2k/api-14-move-storage-files
Automatic merge from submit-queue

move the REST storage creation to its proper packages

Moves the `RESTStorageProvider` interfaces to their proper packages.
2016-09-26 06:16:43 -07:00
Jan Safranek a54c9e2887 Refactor volume controller parameters into a structure
persistentvolumecontroller.NewPersistentVolumeController has 11 arguments now,
put them into a structure.

Also, rename NewPersistentVolumeController to NewController, persistentvolume
is already name of the package.

Fixes #30219
2016-09-26 14:15:25 +02:00
deads2k 48ac4d549d change e2e scale to avoid adapter 2016-09-26 07:58:01 -04:00
Jan Safranek 5ff1597cf9 Rename controller*.go to pv_controller*.go
To make log filtering easier. controller.go is used by several controllers and
matching logs for "pv_controller.*" is much better.
2016-09-26 12:26:58 +02:00
Ke Zhang d03a73f3f2 Variables should be initialized near where it would be used 2016-09-26 14:31:31 +08:00
Kubernetes Submit Queue 437b55bfd5 Merge pull request #33417 from yifan-gu/fix_cap_panic
Automatic merge from submit-queue

Fix an 'index out of range' panic when setting capabilities.

cc @yujuhong @feiskyer
2016-09-25 20:12:41 -07:00
Kubernetes Submit Queue 4785f6f517 Merge pull request #31978 from jsafrane/detach-before-delete
Automatic merge from submit-queue

Do not report error when deleting an attached volume

Persistent volume controller should not send warning events to a PV and mark the PV as failed when the volume is still attached.

This happens when a user quickly deletes a pod and associated PVC - PV is slowly detaching, while the PVC is already deleted and the PV enters Failed phase.

`Deleter.Deleter` can now return `tryAgainError`, which is sent as INFO to the PV to let the user know we did not forget to delete the PV, however the PV stays in Released state. The controller tries again in the next sync (15 seconds by default).

Fixes #31511
2016-09-25 18:55:32 -07:00
Random-Liu 3d1263d2cf Use fakeclock in fake docker client. 2016-09-24 22:43:39 -07:00
Kubernetes Submit Queue f07e18f816 Merge pull request #33426 from ZTE-PaaS/zhangke-patch-052
Automatic merge from submit-queue

Fix TODO: Rename podStatus to apiPodStatus, rename internalPodStatus to podStatus
2016-09-24 19:52:35 -07:00
Kubernetes Submit Queue 9c5bf904c2 Merge pull request #32217 from freehan/kubenetcheck
Automatic merge from submit-queue

nit fixes

Do not merge yet. Wait till it gets bigger. 

fix included:
1. use golang native util to list dir
2016-09-24 03:28:28 -07:00
Kubernetes Submit Queue beba1e2c8f Merge pull request #33275 from maciaszczykm/remove-kubectl-namespace-cmd
Automatic merge from submit-queue

Remove kubectl namespace command

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

It removes deprecated `kubectl namespace` command, which `has been superseded by the context.namespace field of .kubeconfig files.  See 'kubectl config set-context --help' for more details`. It was done nearly two years ago, so like `// TODO remove once people have been given enough time to notice` comment says it may be a good time to get rid of it.

**Special notes for your reviewer**:

None ATM.

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
Remove kubectl namespace command
```
2016-09-24 02:51:39 -07:00
Ke Zhang 41ece9a901 Fix TODO: Rename podStatus to apiPodStatus, rename internalPodStatus to podStatus 2016-09-24 16:17:11 +08:00
Kubernetes Submit Queue 9455b1de54 Merge pull request #33157 from YuPengZTE/devEG
Automatic merge from submit-queue

'eg.' should be 'e.g.'
2016-09-24 00:53:38 -07:00
Kubernetes Submit Queue f9da079330 Merge pull request #33370 from justinsb/fix_typo
Automatic merge from submit-queue

Fix typo: rejcted -> rejected
2016-09-24 00:15:11 -07:00
Kubernetes Submit Queue 64777d37b6 Merge pull request #33268 from deads2k/client-14-rc-svc-lister
Automatic merge from submit-queue

simplify RC listers

Make the RC and SVC listers use the common list functions that more closely match client APIs, are consistent with other listers, and avoid unnecessary copies.
2016-09-23 23:37:15 -07:00
Yifan Gu d5ead764f8 Fix an 'index out of range' panic when setting capabilities. 2016-09-23 19:49:29 -07:00
Kubernetes Submit Queue 1751e47e0f Merge pull request #33386 from yujuhong/message
Automatic merge from submit-queue

CRI: add Message in ContainerStatus

Kubernetes expects a brief CamelCase string as "Reason" and a human-readable
string as "Message" in the conatiner status. It is difficult for kubelet to
derive the other one if the runtime only provides one of the two fields.
Augment the API by adding the "Message" field.

/cc @kubernetes/sig-node
2016-09-23 18:30:20 -07:00
Random-Liu 5eb41e9acb Add container lifecycle hook test. 2016-09-23 17:13:19 -07:00
Random-Liu 72524e45b5 Handle pod spec missing case in kuberuntime. 2016-09-23 17:13:19 -07:00
Kubernetes Submit Queue 61e3c14e1c Merge pull request #33395 from yujuhong/backoff_key
Automatic merge from submit-queue

kuberuntime: include container hash in backoff keys

We should reset the backoff if the content of the container has been updated.

Part of #33189
2016-09-23 16:46:14 -07:00
Yu-Ju Hong cb57dc4cb5 kuberuntime: include container hash in backoff keys
We should reset the backoff if the content of the container has been updated.
2016-09-23 14:52:30 -07:00
Yu-Ju Hong 737769954a CRI: add Message in ContainerStatus
Kubernetes expects a brief CamelCase string as "Reason" and a human-readable
string as "Message" in the conatiner status. It is difficult for kubelet to
derive the other one if the runtime only provides one of the two fields.
Augment the API by adding the "Message" field.
2016-09-23 14:32:54 -07:00
Kubernetes Submit Queue 501f264717 Merge pull request #33337 from mbohlool/o2
Automatic merge from submit-queue

Fix API Installer to generate unique Operation IDs

OperationIDs generated by api_installer.go may not be unique and that causes long auto-generated function names in swagger generated clients. This is a step toward making those IDs unique.

Reference Issue kubernetes/features#53 and #13414
2016-09-23 14:06:40 -07:00
Kubernetes Submit Queue 071927a59d Merge pull request #32549 from smarterclayton/gc_non_kube_legacy
Automatic merge from submit-queue

Allow garbage collection to work against different API prefixes

The GC needs to build clients based only on Resource or Kind. Hoist the
restmapper out of the controller and the clientpool, support a new
ClientForGroupVersionKind and ClientForGroupVersionResource, and use the
appropriate one in both places.

Allows OpenShift to use the GC
2016-09-23 14:06:35 -07:00
Kubernetes Submit Queue 8152cfb9c3 Merge pull request #32670 from soltysh/cron_update
Automatic merge from submit-queue

Remove hacks from ScheduledJobs cron spec parsing 

Previusly `github.com/robfig/cron` library did not allow passing cron spec without seconds. First commit updates the library, which has additional method ParseStandard which follows the standard cron spec, iow. minute, hour, day of month, month, day of week.

@janetkuo @erictune as promised in #30227 I've updated the library and now I'm updating it in k8s
2016-09-23 13:27:16 -07:00
deads2k 7897691483 move straggler registry package 2016-09-23 16:24:49 -04:00
deads2k 17a21c7bdb move reststorage providers to their correct packages 2016-09-23 16:24:48 -04:00
Kubernetes Submit Queue 33eabe675b Merge pull request #33332 from ericchiang/oidc-allow-string-as-group-claim
Automatic merge from submit-queue

oidc authenticator: allow string value as groups claim

Allow the group claim to be a single string instead of an array of
strings. This means the following claim

    {
      "role": "admin"
    }

Will be mapped to the groups

    ["admin"]

cc @kubernetes/sig-auth @mlbiam

closes #33290
2016-09-23 12:41:27 -07:00
Kubernetes Submit Queue 331eb83585 Merge pull request #33376 from luxas/fix_arm_atomics_2
Automatic merge from submit-queue

Move HighWaterMark to the top of the struct in order to fix arm, second time

ref: #33117

Sorry for not fixing everyone at once, but I seriously wasn't prepared for that quick LGTM 😄, so here's the other half.

@lavalamp 

> lgtm, but seriously, this is terrible, we probably have this bug all over. And what if someone embeds the etcdWatcher struct in something else not at the top? We need the compiler to enforce things like this, it just can't be done manually. Can you file or link a golang issue for this?

I totally agree! There isn't currently a way of programmatically detecting this unfortunately.
I guess @davecheney or @minux can explain better to you why it's so hard.

This is noted in https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/multi-platform.md as a corner case indeed.

@pwittrock This should be cherrypicked toghether with #33117
2016-09-23 12:05:09 -07:00
Kubernetes Submit Queue 09e0e025e8 Merge pull request #33346 from freehan/fix-lbsrcrange-update
Automatic merge from submit-queue

disallow user to update loadbalancerSourceRanges

buy myself some time to fix the root cause of #33033
2016-09-23 12:05:04 -07:00
mbohlool d228cc34f3 Fix API Installer to generate unique Operation IDs 2016-09-23 11:42:50 -07:00
Kubernetes Submit Queue 0a4316f11e Merge pull request #32807 from jingxu97/stateupdateNeeded-9-15
Automatic merge from submit-queue

Fix race condition in setting node statusUpdateNeeded flag

This PR fixes the race condition in setting node statusUpdateNeeded flag
in master's attachdetach controller. This flag is used to indicate
whether a node status has been updated by the node_status_updater or
not. When updater finishes update a node status, it is set to false.
When the node status is changed such as volume is detached or new volume
is attached to the node, the flag is set to true so that updater can
update the status again. The previous workflow has a race condition as
follows
1. updater gets the currently attached volume list from the node which needs to be
updated.
2. A new volume A is attached to the same node right after 1 and set the
flag to TRUE
3. updater updates the node attached volume list (which does not include volume A) and then set the flag to FALSE.
The result is that volume A will be never added to the attached volume
list so at node side, this volume is never attached.

So in this PR, the flag is set to FALSE when updater tries to get the
attached volume list (as in an atomic operation). So in the above
example, after step 2, the flag will be TRUE again, in step 3, updater
does not set the flag if updates is sucessful. So after that, flag is
still TRUE and in next round of update, the node status will be updated.
2016-09-23 11:25:16 -07:00
Lucas Käldström 06917531b3 Move HighWaterMark to the top of the struct in order to fix arm, second time 2016-09-23 20:58:28 +03:00
Kubernetes Submit Queue b95fa62fe1 Merge pull request #31163 from juanvallejo/jvallejo_filter-resources-before-printing
Automatic merge from submit-queue

add resource filter handling before printing

**Release note**:
```release-note
release-note-none
```

Resources are currently filtered (in order to prevent printing) at print
time in their HumanReadablePrinter handlers. This design makes it not
possible to filter objects when they are printed using any other
printer, such as YAML, JSON, or the NamePrinter.

This patch removes any filters previously added at the printer level for
pods and adds a way to define resource-specific filters before they are
sent to a printer handler. A woking filter handler for pods has also been
implemented.

Filters affect resources being printed through the HumanReadablePrinter,
YAML, JSON, and `--template` printers.

cc @smarterclayton
2016-09-23 10:45:57 -07:00
Kubernetes Submit Queue 5f815354e0 Merge pull request #33182 from deads2k/api-13-collapse-script-references
Automatic merge from submit-queue

unify available api group versions in our scripts

There are currently many parallel lists of available group versions with slightly different syntaxes in each one.  This collapses them into a single list for us to maintain.  

Also caught spots where the lists didn't match before.

@sttts @ncdc
2016-09-23 10:06:10 -07:00
Davide Agnello fda70d220b ExternalID/InstanceID not returning appropriate error for missing VM
Addresses #33215.
When vCenter returns error vm not found, this is now being translated to
the appropriate error 'cloudprovider.InstanceNotFound' which indicates
to Kubernetes node controller that the VM is in fact not found.
2016-09-23 08:54:35 -07:00
Justin Santa Barbara 7fe6e45fdd Fix typo: rejcted -> rejected 2016-09-23 10:27:10 -04:00
Dr. Stefan Schimanski acf0a5264a Prune unused parameters and call only once 2016-09-23 14:53:09 +02:00
Kubernetes Submit Queue 0829f39b39 Merge pull request #33164 from sttts/sttts-handler-chain-cleanup
Automatic merge from submit-queue

Cleanup genericapiserver handler chain

- move generic (api independent) handler filters to `pkg/genericapiserver/filters`
- entangle `genericapiserver.New()`
- unify signature of all handler filters (also those in `pkg/apiserver`)
2016-09-23 05:26:52 -07:00
deads2k 500959b70c fix RC lister 2016-09-23 08:12:03 -04:00
Kubernetes Submit Queue b2aed32578 Merge pull request #33269 from deads2k/client-15-svc-lister
Automatic merge from submit-queue

simplify svc lister

trying to track down what killed the e2e tests.
2016-09-23 03:10:57 -07:00
Dr. Stefan Schimanski 87356c0623 Cleanup handler chain 2016-09-23 12:03:58 +02:00
Dr. Stefan Schimanski 3799ffa0a8 Simplify genericapiserver.Run() 2016-09-23 12:00:30 +02:00
Dr. Stefan Schimanski 8b33a9ed42 Move TimeoutHandler+MaxInFlightLimit to Config.New() 2016-09-23 12:00:30 +02:00
Kubernetes Submit Queue 1063903d01 Merge pull request #33266 from sttts/sttts-one-installapigroups
Automatic merge from submit-queue

Reduce genericapiserver api surface
2016-09-23 02:32:07 -07:00
Kubernetes Submit Queue 7144f54d78 Merge pull request #32390 from liggitt/ecdhe
Automatic merge from submit-queue

Remove duplicated ECDHE key handling

This PR removes the duplicated ECDHE private key handling. `x509.CreateCertificateRequest` picks the signature type for ECDHE keys already (see https://golang.org/src/crypto/x509/x509.go `signingParamsForPublicKey`). Only the RSA key signature needed customization.

It also defers to `CreateCertificateRequest` to return errors on unknown private key types.
2016-09-23 01:53:20 -07:00
Kubernetes Submit Queue 0e01bc8f3f Merge pull request #33267 from sttts/sttts-lock-apiGroupsForDiscovery
Automatic merge from submit-queue

Add locking around apiGroupsForDiscovery

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

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

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-09-23 01:17:00 -07:00
Kubernetes Submit Queue 13a0ce6822 Merge pull request #31988 from pmorie/gc-log
Automatic merge from submit-queue

Add positive logging for GC events

We have no positive logging for GC events.  This PR:

1.  Adds positive logging at V(4) for success cases
2.  Adds positive logging at V(1) for the first successful GC after a failure
2016-09-23 00:36:43 -07:00
hacktastic 77a203c49f the api does not support filtering health monitors by pool_id, so /lbaas/healthmonitors?pool_id=abc123 will always return all health monitors in your OS tenant. fortunately, we can get the health monitor IDs from the query to /lbaas/pools and delete them 2016-09-22 23:52:32 -07:00
Dr. Stefan Schimanski 0898f62b5c Add locking around apiGroupsForDiscovery 2016-09-23 08:37:50 +02:00
Kubernetes Submit Queue e05e8664d5 Merge pull request #33349 from madhusudancs/etcd-precond-deref-log
Automatic merge from submit-queue

Dereference the UID pointer for a readable error message.

cc @nikhiljindal @quinton-hoole @kubernetes/sig-cluster-federation
2016-09-22 22:42:24 -07:00
Kubernetes Submit Queue ad2224c968 Merge pull request #33264 from sttts/sttts-private-postStartHooks
Automatic merge from submit-queue

Make genericapiserver.PostStartHooks private

Better do not leak members to downstream if not necessary.
2016-09-22 21:18:46 -07:00
Kubernetes Submit Queue 67219f4041 Merge pull request #32867 from kargakis/move-events-sort
Automatic merge from submit-queue

kubectl: move events sorting interface to the api for general use

Split from https://github.com/kubernetes/kubernetes/pull/19343

@kubernetes/kubectl
2016-09-22 20:39:29 -07:00
Madhusudan.C.S c1f0d91c2a Dereference the UID pointer for a readable error message. 2016-09-22 20:34:06 -07:00
Kubernetes Submit Queue 1ef86aa8ab Merge pull request #32906 from caesarxuchao/staging-1.5
Automatic merge from submit-queue

Staging 1.5 client

Created the 1.5 folder and remove the 1.4 folder in the staging area in the master branch.

Content of kubernetes/client-go/1.4 will be pulled from the kubernetes/kubernetes 1.4 branch (https://github.com/kubernetes/contrib/pull/1719)
2016-09-22 19:55:01 -07:00
Kubernetes Submit Queue 1f7e79afbf Merge pull request #33066 from Random-Liu/set-docker-client-version
Automatic merge from submit-queue

Add docker client version.

Addressed https://github.com/kubernetes/kubernetes/issues/29478#issuecomment-248197665.

This partially reverted #31540, because currently we are really trying to connect to docker daemon when creating the client.

This PR updated docker client with real docker apiversion with `UpdateClientVersion`, so that the version related logic of engine-api can work properly, such as https://github.com/docker/engine-api/pull/174/files.

@yujuhong @feiskyer
2016-09-22 19:09:14 -07:00
Minhan Xia ba45a3f74e disallow user to update loadbalancerSourceRanges 2016-09-22 19:04:02 -07:00
Kubernetes Submit Queue 509096af21 Merge pull request #33301 from yujuhong/docker_hacks
Automatic merge from submit-queue

Fake container exec/logs support for in-process docker CRI integration

This is necessary to unblock other work on docker integration, while we are addressing
`logs` and `exec` in the meantime.

This is part of #31459 and #33189

/cc @kubernetes/sig-node
2016-09-22 17:44:37 -07:00
Kubernetes Submit Queue cf8fcd03f0 Merge pull request #31731 from lavalamp/gengo
Automatic merge from submit-queue

Gengo

go2idl is now gengo.
2016-09-22 17:04:19 -07:00
Kubernetes Submit Queue 6b3f5c4147 Merge pull request #33038 from deads2k/api-11-push-deps-down
Automatic merge from submit-queue

remove storage related fields from genericapiserver

Removes `StorageFactory` and `StorageDecorator` from from `genericapiserver` since both constructs are related to building a `RESTStorage`, which should be provided fully formed (or via factory func) to a truly generic API server.

I found this while trying to move the creation API routes earlier.
2016-09-22 17:04:13 -07:00
Yu-Ju Hong 2fc2e71438 Fake container exec/logs support for in-process docker CRI integration
This is a temporary hack to bypass CRI when getting container logs or
running exec in a container. This is necessary to unblock testing and adding
other features in the integration.
2016-09-22 16:03:37 -07:00
Kubernetes Submit Queue 3906acfba8 Merge pull request #33079 from ping035627/ping035627-patch-0920
Automatic merge from submit-queue

Merge the "var" segment

So much "var" doesn't seem clear, suggest to merge them.
2016-09-22 14:24:27 -07:00
Eric Chiang 065ddab5d1 oidc authenticator: allow string value as groups claim
Allow the group claim to be a single string instead of an array of
strings. This means the following claim

    {
      "role": "admin"
    }

Will be mapped to the groups

   ["admin"]
2016-09-22 14:23:56 -07:00
Jing Xu 14cad206f5 Fix race conditino in setting node statusUpdateNeeded flag
This PR fixes the race condition in setting node statusUpdateNeeded flag
in master's attachdetach controller. This flag is used to indicate
whether a node status has been updated by the node_status_updater or
not. When updater finishes update a node status, it is set to false.
When the node status is changed such as volume is detached or new volume
is attached to the node, the flag is set to true so that updater can
update the status again. The previous workflow has a race condition as
follows
1. updater gets the currently attached volume list from the node which needs to be
updated.
2. A new volume A is attached to the same node right after 1 and set the
flag to TRUE
3. updater updates the node attached volume list (which does not include volume A) and then set the flag to FALSE.
The result is that volume A will be never added to the attached volume
list so at node side, this volume is never attached.

So in this PR, the flag is set to FALSE when updater tries to get the
attached volume list (as in an atomic operation). So in the above
example, after step 2, the flag will be TRUE again, in step 3, updater
does not set the flag if updates is sucessful. So after that, flag is
still TRUE and in next round of update, the node status will be updated.

This PR also changes a unit test due to the workflow changes
2016-09-22 14:02:30 -07:00
Kubernetes Submit Queue 4b700f41ec Merge pull request #32944 from k82cn/refactor_builder_visitorResult
Automatic merge from submit-queue

Refactor Builder.visitorResult by extra methonds.

**What this PR does / why we need it**:
Code polish; it'll make code readable.
2016-09-22 13:45:09 -07:00
Daniel Smith db3e549bd1 more usages of go2idl 2016-09-22 13:42:46 -07:00
Kubernetes Submit Queue 3149a2b7c6 Merge pull request #33286 from PhilibertDugas/fix/32747_stacktrace-log-from-apiserver
Automatic merge from submit-queue

Apiserver don't log stacktrace when proxying

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

When we are proxying unexpected status from a service or a pod, we print the stack traces (which is not the wanted behaviour). This is an attempt at fixing the issue #32747,

With the `RequestInfoResolver` struct, it's possible to inspect the request and get the `Verb`. In this case, the `proxy` value is what I was looking for to avoid logging stack traces.

I'm wrapping the `.Log()` call with an `if` statement to remove all stack traces logging when the call is a proxy from a service or a pod

Another approach would have been to add another kind of `StacktracePred` in the `httplog` package. I found this path to be trickier to code as it's currently only accepting int values.

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

**Special notes for your reviewer**: N/A

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-09-22 13:05:21 -07:00
Kubernetes Submit Queue e9f4db2748 Merge pull request #27714 from jsafrane/event-recycle
Automatic merge from submit-queue

Send recycle events from pod to pv.

This allows users to diagnose what's wrong with recycler. Recycler pods are started automatically with a cryptic name and they are deleted immediately when they finish.

e.g, `kubectl describe pv` could show that NFS cannot be mounted (and how many pods have tried it):

```
  FirstSeen     LastSeen        Count   From                            SubobjectPath   Type            Reason          Message
  ---------     --------        -----   ----                            -------------   --------        ------          -------
  59m           59m             1       {persistentvolume-controller }                  Warning         RecyclerPod     Recycler pod: Unable to mount volumes for pod "recycler-for-nfs_default(5421800e-347b-11e6-a79b-3c970e965218)": timeout expired waiting for volumes to attach/mount for pod "recycler-for-nfs"/"default". list of unattached/unmounted volumes=[vol]
  53m           53m             1       {persistentvolume-controller }                  Warning         RecyclerPod     Recycler pod: Unable to mount volumes for pod "recycler-for-nfs_default(3c9809e5-347c-11e6-a79b-3c970e965218)": timeout expired waiting for volumes to attach/mount for pod "recycler-for-nfs"/"default". list of unattached/unmounted volumes=[vol]
  46m           46m             1       {persistentvolume-controller }                  Warning         RecyclerPod     Recycler pod: Unable to mount volumes for pod "recycler-for-nfs_default(250dd2a2-347d-11e6-a79b-3c970e965218)": timeout expired waiting for volumes to attach/mount for pod "recycler-for-nfs"/"default". list of unattached/unmounted volumes=[vol]
  40m           40m             1       {persistentvolume-controller }                  Warning         RecyclerPod     Recycler pod: Unable to mount volumes for pod "recycler-for-nfs_default(0d84ea33-347e-11e6-a79b-3c970e965218)": timeout expired waiting for volumes to attach/mount for pod "recycler-for-nfs"/"default". list of unattached/unmounted volumes=[vol]
  33m           33m             1       {persistentvolume-controller }                  Warning         RecyclerPod     Recycler pod: Unable to mount volumes for pod "recycler-for-nfs_default(f5fb63bf-347e-11e6-a79b-3c970e965218)": timeout expired waiting for volumes to attach/mount for pod "recycler-for-nfs"/"default". list of unattached/unmounted volumes=[vol]
  27m           27m             1       {persistentvolume-controller }                  Warning         RecyclerPod     Recycler pod: Unable to mount volumes for pod "recycler-for-nfs_default(de7128fd-347f-11e6-a79b-3c970e965218)": timeout expired waiting for volumes to attach/mount for pod "recycler-for-nfs"/"default". list of unattached/unmounted volumes=[vol]
  1h            3m              75      {persistentvolume-controller }                  Normal          RecyclerPod     Recycler pod: Successfully assigned recycler-for-nfs to 127.0.0.1
  1h            3m              76      {persistentvolume-controller }                  Normal          RecyclerPod     Recycler pod: Pod was active on the node longer than specified deadline
  1h            1m              12      {persistentvolume-controller }                  Warning         RecyclerPod     Recycler pod: Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "recycler-for-nfs"/"default". list of unattached/unmounted volumes=[vol]
  20m           1m              4       {persistentvolume-controller }                  Warning         RecyclerPod     (events with common reason combined)
```

These steps were necessary:

- added event watcher to volume.RecycleVolumeByWatchingPodUntilCompletion
- pass all these events through volume plugins to volume controller
- rework volume.RecycleVolumeByWatchingPodUntilCompletion unit tests to a table (too much copy-paste)
- fix all unit tests along the way
2016-09-22 12:18:53 -07:00
Yu-Ju Hong c43a106b26 Move ConvertPodStatusToRunningPod back to the kubelet/container package
This avoids unnecessary imports between of kuberuntime from dockertools/rkt,
which implements the same kubecontainer.Runtime interface.
2016-09-22 12:13:44 -07:00
Clayton Coleman 97c35fcc67
Allow garbage collection to work against different API prefixes
The GC needs to build clients based only on Resource or Kind. Hoist the
restmapper out of the controller and the clientpool, support a new
ClientForGroupVersionKind and ClientForGroupVersionResource, and use the
appropriate one in both places.
2016-09-22 15:00:58 -04:00
Jordan Liggitt ec200a9edf
Remove duplicated ECDHE key handling 2016-09-22 14:52:10 -04:00
Kubernetes Submit Queue 4ab5a76338 Merge pull request #33103 from deads2k/controller-03-kill-non-generatedclient
Automatic merge from submit-queue

switch controller manager to generated clients

Switches the controller manager to generated clients.

@ncdc ptal
2016-09-22 11:37:01 -07:00
Kubernetes Submit Queue 5b609f212c Merge pull request #32126 from intelsdi-x/kvm_fw
Automatic merge from submit-queue

Add port forwarding for rkt with kvm stage1

Port forwarding for rkt kvm using `socat`.
cc @yifan-gu @euank @pskrzyns @lukasredynk
2016-09-22 10:57:09 -07:00
deads2k 43db7c0c44 generated code that was missing before 2016-09-22 13:30:42 -04:00
deads2k e85ecc98dd update broken versions for client gen 2016-09-22 13:30:41 -04:00
deads2k 7a8fa18116 update generation scripts to share API group version constants 2016-09-22 13:30:41 -04:00
Philibert Dugas b557acf987
Update for the PR feedback 2016-09-22 13:30:04 -04:00
Kubernetes Submit Queue a8053c7c59 Merge pull request #33238 from mbohlool/openapi
Automatic merge from submit-queue

Move openapi common code to genericapiserver/openapi/common

a follow up to #32622

Reference: #13414
2016-09-22 10:20:48 -07:00
Kubernetes Submit Queue 46123a1694 Merge pull request #33112 from vishh/fix-qos
Automatic merge from submit-queue

Ignore opaque or counted resources from Pod QoS

Fixes #33108
2016-09-22 09:09:05 -07:00
Philibert Dugas 9c2705a5a2
Apiserver don't log stacktrace when proxying
Attempt at closing #32747,

With the `RequestInfoResolver` struct, it's possible to inspect the
request and get the `Verb`. In this case, the `proxy` value is what I
was looking for to avoid logging stacktraces.

I'm wrapping the `.Log()` call with an `if` statement to remove all
stacktrace logging when we proxied through the apiserver

Another approach would have been to add another kind of
`StacktracePred` in the `httplog` package. I found this path to be
trickier to code as it's currently only accepting int values.
2016-09-22 12:08:06 -04:00
Kubernetes Submit Queue 6e25117891 Merge pull request #32655 from dshulyak/fix_node_fake_update
Automatic merge from submit-queue

Fix FakeNodeHandler Update behaviour

Two problems:
1. Get is always using Existing nodes slice, and you will for sure miss any updated data
2. Each Update adds a duplicate node entry to UpdatedNodes slice

For the 1st, we will try to find a node in UpdatedNodes slice (same as for the List).
2nd - append only if there is no node with same name as updated, if there is we will replace object in UpdatedNodes slice.
2016-09-22 07:43:18 -07:00
Kubernetes Submit Queue f230e6c7bc Merge pull request #33007 from smarterclayton/fix_versioned_event
Automatic merge from submit-queue

Correct versioned.Event output in Swagger

Fixes #24240

```release-note
The value of the `versioned.Event` object (returned by watch APIs) in the Swagger 1.2 schemas has been updated from `*versioned.Event` which was not expected by many client tools. The new value is consistent with other structs returned by the API.
```
2016-09-22 07:03:28 -07:00
deads2k 7ee5b26ad1 incorrect key determination 2016-09-22 09:55:24 -04:00
Marcin Maciaszczyk d2a288de6a Remove kubectl namespace command 2016-09-22 15:46:20 +02:00
Kubernetes Submit Queue b60df6c312 Merge pull request #33228 from yujuhong/pull_throttling
Automatic merge from submit-queue

Move image pull throttling logic to pkg/kubelet/images

This is part of #31458

This allows runtimes in different packages (dockertools, rkt, kuberuntime) to
share the same logic. Before this change, only dockertools support this
feature. Now all three packages support image pull throttling.

/cc @kubernetes/sig-node
2016-09-22 06:23:39 -07:00
deads2k f6882e8465 remove storage related fields from genericapiserver 2016-09-22 09:21:34 -04:00
deads2k 483af28944 fix up service lister 2016-09-22 09:12:37 -04:00
Kubernetes Submit Queue aa935bb8a4 Merge pull request #33170 from soltysh/audit_improvements
Automatic merge from submit-queue

Remove closing audit log file and add error check when writing to audit

This picks the order fix from #33164. Additionally I've removed entirely closing the log file, since it didn't make sense where it was. I've also added error checks when actually writing to audit logs.

@sttts ptal

**1.4 justification:**

Risk: the code only runs if auditing is enabled with an apiserver flag. So the risk is low.
Rollback: nothing should depend on this
Cost: the auditing feature is broken because the impersonation filter is applied before and you might not see the proper user when using `--as` flag. Additionally no errors are logged if writing to audit fails.
2016-09-22 05:06:33 -07:00
Dr. Stefan Schimanski c727e27602 Reduce genericapiserver api surface 2016-09-22 13:43:32 +02:00
Dr. Stefan Schimanski 34365c1edd Make genericapiserver.PostStartHooks private 2016-09-22 12:38:47 +02:00
Kubernetes Submit Queue 5af04d1dd1 Merge pull request #32876 from errordeveloper/more-cert-utils
Automatic merge from submit-queue

Refactor cert utils into one pkg, add funcs from bootkube for kubeadm to use

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

We have ended-up with rather incomplete and fragmented collection of utils for handling certificates. It may be worse to consider using `cfssl` for doing all of these things, but for now there is some functionality that we need in `kubeadm` that we can borrow from bootkube. It makes sense to move the utils from bookube into core, as discussed in #31221.

**Special notes for your reviewer**: I've taken the opportunity to review names of existing funcs and tried to make some improvements in that area (with help from @peterbourgon).

**Release note**:

```release-note
NONE
```
2016-09-22 01:29:46 -07:00
Kubernetes Submit Queue e115a4282d Merge pull request #33169 from deads2k/api-12-move-groups
Automatic merge from submit-queue

move registry packages for all API groups

This continues the pattern of `registry/<group>/resource` for our backing storage.  This entire pull is nothing but moves.  I'll reswizzle the actual storage next, but these are cargo-culted everywhere, so I want to lay this down early.

@sttts @ncdc
2016-09-22 00:51:59 -07:00
Kubernetes Submit Queue c46bc88f04 Merge pull request #31491 from dims/fixes-issue-13598
Automatic merge from submit-queue

Allow secure access to apiserver from Admission Controllers

* Allow options.InsecurePort to be set to 0 to switch off insecure access
* In NewSelfClient, Set the TLSClientConfig to the cert and key files
  if InsecurePort is switched off
* Mint a bearer token that allows the client(s) created in NewSelfClient
  to talk to the api server
* Add a new authenticator that checks for this specific bearer token

Fixes #13598
2016-09-21 21:31:56 -07:00
Kubernetes Submit Queue fee69eedbf Merge pull request #33141 from liggitt/tls-config-mutation
Automatic merge from submit-queue

don't mutate original master->kubelet TLS config

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

```release-note
Resolves x509 verification issue with masters dialing nodes when started with --kubelet-certificate-authority
```
2016-09-21 19:22:46 -07:00
Yu-Ju Hong ee5b6a2550 Move image pull throttling logic to kubelet/images
This allows runtimes in different packages (dockertools, rkt, kuberuntime) to
share the same logic. Before this change, only dockertools support this
feature. Now all three packages support image pull throttling.
2016-09-21 18:31:04 -07:00
mbohlool c25ecc43ab Move openapi common code to genericapiserver/openapi/common 2016-09-21 17:01:54 -07:00
Antoine Pelisse 938872582e Revert "simplify RC and SVC listers" 2016-09-21 15:49:38 -07:00
Chao Xu a4e62297d6 fix tests 2016-09-21 14:44:39 -07:00
deads2k 561f8d75a5 move core resource registry packages 2016-09-21 10:11:50 -04:00
juanvallejo 7000e2cf4f
add resource handling before printing
Resources are currently filtered (in order to prevent printing) at print
time in their HumanReadablePrinter handlers. This design makes it not
possible to filter objects when they are printed using any other
printer, such as YAML, JSON, or the NamePrinter.

This patch removes any filters previously added at the printer level for
pods and adds a way to define resource-specific filters before they are
sent to a printer handler. A woking filter handler for pods has also
been
implemented.

Filters affect resources being printed through the HumanReadablePrinter,
YAML, JSON, and `--template` printers.
2016-09-21 10:03:59 -04:00
Maciej Szulik 5873c2679c Remove closing audit log file and add error check when writing to audit 2016-09-21 15:23:38 +02:00
deads2k e9c1b87b80 move extensions registry packages 2016-09-21 09:14:38 -04:00
deads2k 7ee8596a02 refactor small API group packages 2016-09-21 09:14:38 -04:00
Kubernetes Submit Queue 313ef63993 Merge pull request #32680 from sttts/sttts-gracefully-kubectl-without-version
Automatic merge from submit-queue

Behave gracefully in kubectl if /version returns 404

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

It's only about caching the swagger spec here. So it's safe to fall back to non-caching mode and continue.
2016-09-21 04:59:16 -07:00
Kubernetes Submit Queue 2d9d84dc64 Merge pull request #32888 from deads2k/client-10-fixup-remaining-listers
Automatic merge from submit-queue

simplify RC and SVC listers

Make the RC and SVC listers use the common list functions that more closely match client APIs, are consistent with other listers, and avoid unnecessary copies.
2016-09-21 04:13:56 -07:00
Kubernetes Submit Queue 4099a5cc98 Merge pull request #33136 from smarterclayton/default_config
Automatic merge from submit-queue

When client config is default or default is invalid, check ICC

Alternative fix to #33019
2016-09-21 02:21:34 -07:00
Kubernetes Submit Queue 02605106a6 Merge pull request #29505 from kargakis/debug-recreate-flake
Automatic merge from submit-queue

controller: enhance timeout error message for Recreate deployments

Makes the error message from https://github.com/kubernetes/kubernetes/issues/29197 more obvious

@kubernetes/deployment
2016-09-21 01:45:47 -07:00
Kubernetes Submit Queue b245886658 Merge pull request #33058 from MHBauer/dead-interface
Automatic merge from submit-queue

delete private interface with no references in package

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:
code quality. 

**Which issue this PR fixes**:
does not fix anything. removes unused interface. 

**Special notes for your reviewer**:
It does not do anything. Let us remove it.

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
NONE
```
2016-09-20 23:35:49 -07:00
YuPengZTE 5865a31e77 'eg.' should be 'e.g.'
Signed-off-by: YuPengZTE <yu.peng36@zte.com.cn>
2016-09-21 14:28:22 +08:00
Clayton Coleman 07f079216e
Make clientcmd defaulting a function of ConfigOverrides and LoadingRules
This commit moves away from using a global variable for default
configuration checking, and instead exposes a method on LoadingRules to
determine whether a particular restclient.Config should be considered
"default". This allows kubectl to provide its own defaults (the same
as before, KUBERNETES_MASTER and the static localhost:8080 values) while
allowing other clients to avoid defining them.

In-cluster config defaulting is now easier to read.
2016-09-21 01:28:06 -04:00
Jordan Liggitt f3c80048f6
don't mutate original client TLS config 2016-09-21 00:57:20 -04:00
Kubernetes Submit Queue 735fca1c03 Merge pull request #32622 from mbohlool/openapi
Automatic merge from submit-queue

Move generated openAPI specs out of genericapiserver and make it configurable

A follow up to #31468

Generated OpenAPI Spec does not belong to genericapiserver package. A new package "generated" created in hope of all generated codes goes into it in future. Openapi folder of that package contains generated definitions and generic API server will accept the definition map as a configuration parameter.

Reference: #13414
2016-09-20 21:42:57 -07:00
Mayank Kumar 822b2d791c fix drain help and make consistent with doc 2016-09-20 21:42:01 -07:00
Kubernetes Submit Queue d323fed024 Merge pull request #33003 from hongchaodeng/etcd_fix2
Automatic merge from submit-queue

stop etcd watcher when watch chan is closed

When startWatching() stops due to the watch chan is closed, the watcher could still keeps running in the background. When this case happen, we should stop the watcher entirely and close ResultChan() too.
2016-09-20 20:21:24 -07:00
Matt Liggett ce0e7586a8 Only approve evictions when budgets would stay enforced after.
Prior to this, we would approve eviction as long as the current state of
the pods matched the budget.  The new version requires that after the
eviction, the pods would still match the budget.

Also update tests to match.
2016-09-20 18:23:50 -07:00