Commit Graph

17562 Commits (27d096d27d60d32c1978e08db82f28da17333405)

Author SHA1 Message Date
Jeff Grafton 27d096d27d Rename build-tools/ back to build/ 2016-12-14 13:42:15 -08:00
Kubernetes Submit Queue 6fa4042211 Merge pull request #38690 from sttts/sttts-swagger-postbuildhandler
Automatic merge from submit-queue

genericapiserver: unify swagger and openapi in config

- make swagger config customizable
- remove superfluous `Config.Enable*` flags for OpenAPI and Swagger.

This is necessary for downstream projects to tweak the swagger spec.
2016-12-14 11:11:02 -08:00
Dr. Stefan Schimanski c341cb55e5 Update bazel 2016-12-14 18:41:04 +01:00
Dr. Stefan Schimanski cab89a67df genericapiserver: unify swagger and openapi in config 2016-12-14 18:41:04 +01:00
Kubernetes Submit Queue b1acd15046 Merge pull request #38699 from deads2k/auth-07-better-message
Automatic merge from submit-queue (batch tested with PRs 38724, 38699)

improve the forbidden message

Improves the forbidden message to include more details about what was denied.

`User "foo" cannot list replicasets.extensions in the namespace "default". `
`User "foo" cannot list replicasets.extensions at the cluster scope. `

@xilabao looks like you looking in a similar area, but focused on errors.
@sttts a lot of usual reviewers are out.
2016-12-14 08:21:48 -08:00
Kubernetes Submit Queue bf7daae954 Merge pull request #38724 from deads2k/fed-12-fix-exec
Automatic merge from submit-queue

fix connection upgrades through kuberentes-discovery

The initial upgrade through the proxy doesn't use the passed transport to handle the communication to the remote side.  Since we need auth proxy headers, this broke the upgrade for exec.

This sets those headers once if its an upgrade request (the transport stomps them if called anyway, so it won't shadow.).

@sttts I think this is the last required piece.  Then we start wiring in for e2e.
2016-12-14 07:45:04 -08:00
deads2k f6829bbde7 improve the forbidden message 2016-12-14 09:53:55 -05:00
Kubernetes Submit Queue e338afbca7 Merge pull request #38533 from DirectXMan12/bug/priority-restmapper-versions
Automatic merge from submit-queue (batch tested with PRs 38720, 38533)

Priority REST Mapper: Actually honor user choice

```release-note
Fixes bug in resolving client-requested API versions
```

RESTMapping takes a desired GroupKind, and a set of versions, and
returns a rest mapper for the first matching version.  It also has a
list of built-in discovered prioritized versions, to which it appends
the user versions.

However, when it goes to parse the versions, it parses them as
GroupVersions.  Since only a version was passed, the group will be the
empty group (""), which will only match rest mappings for the empty
group, ergo, none of the user's versions will match if they are
attempting a match for a non-emtpy-group GroupKind.

This fixes that by taking the parsed GroupVersion, and overriding the
Group with the Group from the passed-in GroupKind.
2016-12-14 05:52:48 -08:00
Kubernetes Submit Queue 11c1cd876b Merge pull request #38720 from deads2k/api-51-fix-impersonation
Automatic merge from submit-queue

prevent audit filter from panic-ing on missing user info

master version of https://github.com/kubernetes/kubernetes/pull/38717
2016-12-14 05:36:27 -08:00
Kubernetes Submit Queue bd522d1daa Merge pull request #38648 from sykesm/fake-propagates-ns
Automatic merge from submit-queue

Fake clientset propagates namespace to objects on create/update

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

Unlike the real Clientset, the fake Clientset requires creates and updates of namespaced objects to have the namespace specified in the target runtime object metadata. This difference forces API clients using the fake Clientset for test to propagate the namespaces to the runtime objects in the production code. This propagation is unnecessary and should be handled by the fake implementation.

**Which issue this PR fixes**: fixes kubernetes/client-go#48

**Special notes for your reviewer**:

**Release note**:
NONE
2016-12-14 03:46:15 -08:00
Kubernetes Submit Queue 7d235e147c Merge pull request #38175 from sttts/sttts-server-fatal
Automatic merge from submit-queue

apiserver(s): Replace glog.Fatals with fmt.Errorfs
2016-12-14 02:00:39 -08:00
Dr. Stefan Schimanski ec3b2c44f6 Fix logic in loopback client creation 2016-12-14 09:35:47 +01:00
Kubernetes Submit Queue af23f40f82 Merge pull request #37272 from brendandburns/cleanup
Automatic merge from submit-queue

Remove 'minion' from the code in two places in favor of 'node'

Part of https://github.com/kubernetes/kubernetes/issues/1111
2016-12-14 00:09:43 -08:00
Kubernetes Submit Queue 0cd3cb7598 Merge pull request #38334 from mogthesprog/morganj/remove-azure-subnet-routetable-check
Automatic merge from submit-queue (batch tested with PRs 38638, 38334)

Remove Azure Subnet RouteTable check

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

PR Removes the subnet configuration check for Azure cloudprovider. The subnet check ensures that the subnet is associated with the Route Table. However if the VNET is in a different Azure Resource Group then the check fails, even if the subnet is already valid. This a stop gap fix, to allow Kubernetes to be deployed to Custom VNETs in Azure, that may reside in a different resource group to the cluster.

fixes #38134 

@colemickens
2016-12-13 22:36:36 -08:00
Kubernetes Submit Queue 6893017b39 Merge pull request #38430 from freehan/cri-docker-network
Automatic merge from submit-queue (batch tested with PRs 38689, 38743, 38734, 38430)

apply sandbox network mode based on network plugin

This allows CRI to use docker's network bridge. Can be combined with noop network plugin. This allows to use docker0 with no further configuration. Good for tools like minikube/hyperkube.
2016-12-13 21:25:36 -08:00
Kubernetes Submit Queue 7b8ecda289 Merge pull request #38743 from caesarxuchao/remove
Automatic merge from submit-queue

Remove accidentally committed files

Accidentally committed in #37534.
2016-12-13 20:44:16 -08:00
Chao Xu 411128f294 remove wrongly committed files 2016-12-13 19:44:51 -08:00
Kubernetes Submit Queue c40404ae9a Merge pull request #38435 from timstclair/remotecmd-refactor
Automatic merge from submit-queue

Refactor remotecommand options parsing

Prerequisite to https://github.com/kubernetes/kubernetes/issues/36187 - This separates the options from the request, so they can be pulled from elsewhere.

/cc @liggitt
2016-12-13 18:12:15 -08:00
Kubernetes Submit Queue 1d3c7ca758 Merge pull request #38348 from euank/doc-our-privilege
Automatic merge from submit-queue (batch tested with PRs 38727, 38726, 38347, 38348)

Add 'privileged' to sandbox to indicate if any container might be privileged in it, document privileged

Right now, the privileged flag is this magic thing which does "whatever Docker does". This documents it to make it a little less magic.

In addition, due to how rkt uses `systemd-nspawn` as an outer layer of isolation in creating the sandbox, it's helpful to know beforehand whether the pod will be privileged so additional security options can be applied earlier / applied at all.

I suspect the same indication will be useful for userns since userns should also occur at the pod layer, but it's possible that will be a separate/additional field.


cc @lucab @jonboulle @yujuhong @feiskyer @kubernetes/sig-node 


```release-note
NONE
```
2016-12-13 17:31:53 -08:00
Kubernetes Submit Queue 63cf217b92 Merge pull request #38347 from euank/remove-extra-hn-check
Automatic merge from submit-queue (batch tested with PRs 38727, 38726, 38347, 38348)

kubelet: remove redundant hostNetwork helper

Trivial cleanup.
2016-12-13 17:31:51 -08:00
Tim St. Clair bc3ade7454
Refactor remotecommand options parsing 2016-12-13 16:09:23 -08:00
Minhan Xia 04c3757a06 apply sandbox network mode based on network plugin 2016-12-13 16:00:23 -08:00
Kubernetes Submit Queue 641654836b Merge pull request #36518 from apelisse/owners-pkg-runtime
Automatic merge from submit-queue

Curating Owners: pkg/runtime

cc @lavalamp @smarterclayton @deads2k @caesarxuchao

In an effort to expand the existing pool of reviewers and establish a
two-tiered review process (first someone lgtms and then someone
experienced in the project approves), we are adding new reviewers to
existing owners files.


If You Care About the Process:
------------------------------

We did this by algorithmically figuring out who’s contributed code to
the project and in what directories.  Unfortunately, that doesn’t work
well: people that have made mechanical code changes (e.g change the
copyright header across all directories) end up as reviewers in lots of
places.

Instead of using pure commit data, we generated an excessively large
list of reviewers and pruned based on all time commit data, recent
commit data and review data (number of PRs commented on).

At this point we have a decent list of reviewers, but it needs one last
pass for fine tuning.

Also, see https://github.com/kubernetes/contrib/issues/1389.

TLDR:
-----

As an owner of a sig/directory and a leader of the project, here’s what
we need from you:

1. Use PR https://github.com/kubernetes/kubernetes/pull/35715 as an example.

2. The pull-request is made editable, please edit the `OWNERS` file to
remove the names of people that shouldn't be reviewing code in the
future in the **reviewers** section. You probably do NOT need to modify
the **approvers** section. Names asre sorted by relevance, using some
secret statistics.

3. Notify me if you want some OWNERS file to be removed.  Being an
approver or reviewer of a parent directory makes you a reviewer/approver
of the subdirectories too, so not all OWNERS files may be necessary.

4. Please use ALIAS if you want to use the same list of people over and
over again (don't hesitate to ask me for help, or use the pull-request
above as an example)
2016-12-13 13:27:17 -08:00
deads2k cd5f8a85f0 support exec through discovery 2016-12-13 15:55:54 -05:00
Kubernetes Submit Queue 4505224cd3 Merge pull request #35436 from danwinship/utilversion
Automatic merge from submit-queue

Add a package for handling version numbers (including non-"Semantic" versions)

As noted in #32401, we are using Semantic Version-parsing libraries to parse version numbers that aren't necessarily "Semantic". Although, contrary to what I'd said there, it turns out that this wasn't actually currently a problem for the iptables code, because the regexp used to extract the version number out of the "iptables --version" output only pulled out three components, so given "iptables v1.4.19.1", it would have extracted just "1.4.19". Still, it could be a problem if they later release "1.5" rather than "1.5.0", or if we eventually need to _compare_ against a 4-digit version number.

Also, as noted in #23854, we were also using two different semver libraries in different parts of the code (plus a wrapper around one of them in pkg/version).

This PR adds pkg/util/version, with code to parse and compare both semver and non-semver version strings, and then updates kubernetes to use it everywhere (including getting rid of a bunch of code duplication in kubelet by making utilversion.Version implement the kubecontainer.Version interface directly).

Ironically, this does not actually allow us to get rid of either of the vendored semver libraries, because we still have other dependencies that depend on each of them. (cadvisor uses blang/semver and etcd uses coreos/go-semver)

fixes #32401, #23854
2016-12-13 12:10:38 -08:00
Kubernetes Submit Queue 702f545aab Merge pull request #37968 from sjenning/qos-pod-status-field
Automatic merge from submit-queue (batch tested with PRs 38171, 37968)

add QoS pod status field

Right now, applications retrieving pod information must reimplement the QoS classification logic on the client side if they wish to know the QoS class of the pod.

The PR adds the QoS class to the pod status so it can be used directly by clients.

This is a step toward addressing #33255

@ConnorDoyle @derekwaynecarr @vishh
2016-12-13 11:51:35 -08:00
Kubernetes Submit Queue 0175399d49 Merge pull request #38171 from xingzhou/kube-typo
Automatic merge from submit-queue

Fixed a typo of wildcard DNS regex variable name.

Happened to see the typo while reading code, fixed the typo and refined the code.
2016-12-13 11:28:30 -08:00
Kubernetes Submit Queue 085f0d74dc Merge pull request #38538 from juanvallejo/jvallejo/dont-report-success-if-obj-not-patched
Automatic merge from submit-queue

Prevent "patched" output on obj not patched

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

This patch compares an original object against a patched object returned
from the server and only announces that the object was successfully
patched if the object returned from the server does not equal the
original object.

@fabianofranz @kubernetes/cli-review
2016-12-13 10:42:26 -08:00
deads2k 9676fe9948 prevent audit filter from panic-ing on missing user info 2016-12-13 13:32:41 -05:00
Matthew Sykes c55d9a2d35 Propagate namespace to objects on create/update 2016-12-13 10:41:46 -05:00
Dan Winship c788793868 Port remaining code to pkg/util/version 2016-12-13 08:53:24 -05:00
Dan Winship f369372dad Drop version-parsing from pkg/version
pkg/version is now just version constants, etc, not version parsing
2016-12-13 08:53:19 -05:00
Dan Winship d95181fa1e Port iptables code to pkg/util/version, don't use semvers 2016-12-13 08:53:04 -05:00
Dan Winship bb60f0415a Add a package for handling version numbers (including non-semvers) 2016-12-13 08:53:00 -05:00
Kubernetes Submit Queue 15f9572b8c Merge pull request #38613 from kargakis/do-not-adopt-when-deleted
Automatic merge from submit-queue

controller: adopt pods only when controller is not deleted

When a replica set is deleted it will continue adopting pods thus driving the worker that handles it in erroring out because the adoption is [always cancelled](59c313730c/pkg/controller/controller_ref_manager.go (L110)) in the controller reference manager.
```
E1212 14:40:31.245773    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-73c3m_791e16cb-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.258462    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-73c3m_791e16cb-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.259131    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-73c3m_791e16cb-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.259149    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-wrmt8_791e3d46-c070-11e6-a234-68f72840e7df because the controlller is being deleted
I1212 14:40:31.268012    7964 deployment_controller.go:314] Error syncing deployment e2e-tests-deployment-2rr3m/test-rollover-deployment: Operation cannot be fulfilled on deployments.extensions "test-rollover-deployment": the object has been modified; please apply your changes to the latest version and try again
E1212 14:40:31.277252    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-73c3m_791e16cb-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.277276    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-wrmt8_791e3d46-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.277287    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-bmqpn_81482114-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.289148    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-b6s4x_82fa8343-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.289169    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-73c3m_791e16cb-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.289176    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-wrmt8_791e3d46-c070-11e6-a234-68f72840e7df because the controlller is being deleted
E1212 14:40:31.289181    7964 replica_set.go:616] cancel the adopt attempt for pod e2e-tests-deployment-2rr3m_test-rollover-deployment-1981456318-bmqpn_81482114-c070-11e6-a234-68f72840e7df because the controlller is being deleted
```

@kubernetes/deployment @caesarxuchao
2016-12-13 04:57:49 -08:00
Kubernetes Submit Queue f02c8e47bc Merge pull request #38669 from caesarxuchao/fix-cacher
Automatic merge from submit-queue

Fix leaking goroutines in watch cache

Fixes #38670 which causes leaked goroutines in the API server. The root cause is: if the WatchServer timeout [fires](https://github.com/kubernetes/kubernetes/blob/master/pkg/apiserver/watch.go#L187-L188) when the `result` channel is full, `sendWatchCacheEvent` will be blocked on the write to the `result` even though `cacheWatch.Stop()` is [called](https://github.com/kubernetes/kubernetes/blob/master/pkg/apiserver/watch.go#L171), because WatchServer stops consuming the `result` channel after the timeout.
Thanks to @krousey for identifying the problem. cc @mml @yujuhong
2016-12-13 00:43:08 -08:00
Chao Xu 7e787b144a fix leaking goroutine issues in watch cache 2016-12-12 21:41:33 -08:00
Kubernetes Submit Queue 8abbedae54 Merge pull request #38315 from mikedanese/pin-gazel
Automatic merge from submit-queue

Pin gazel to a version and support cgo

This fixes the bazel build.

@krousey who is buildcop
2016-12-12 19:32:29 -08:00
Seth Jennings 12b254db93 add QoS pod status field 2016-12-12 21:22:03 -06:00
Kubernetes Submit Queue f45e918b8b Merge pull request #35833 from apelisse/owners-pkg-controller
Automatic merge from submit-queue

Curating Owners: pkg/controller

cc @jsafrane @mikedanese @bprashanth @derekwaynecarr @thockin @saad-ali

In an effort to expand the existing pool of reviewers and establish a
two-tiered review process (first someone **lgtms** and then someone
experienced in the project **approves**), we are adding new reviewers to
existing owners files.
## If You Care About the Process:

We did this by algorithmically figuring out who’s contributed code to
the project and in what directories.  Unfortunately, that doesn’t work
perfectly: people that have made mechanical code changes (e.g change the
copyright header across all directories) end up as reviewers in lots of
places.

Instead of using pure commit data, we generated an excessively large
list of reviewers and pruned based on all time commit data, recent
commit data and review data (number of PRs commented on).

At this point we have a decent list of reviewers, but it needs one last
pass for fine tuning.
## TLDR:

As an owner of a sig/directory and a leader of the project, here’s what
we need from you:
1. Use PR https://github.com/kubernetes/kubernetes/pull/35715 as an example.
2. The pull-request is made editable, please edit the OWNERS file to add
   the names of people that should be reviewing code in the future in the **reviewers** section. You probably do NOT need to modify the **approvers** section.
3. Notify me if you want some OWNERS file to be removed.  Being an approver or reviewer
   of a parent directory makes you a reviewer/approver of the subdirectories too, so not all
   OWNERS files may be necessary.
4. Please use ALIAS if you want to use the same list of people over and
   over again (don't hesitate to ask me for help, or use the pull-request
   above as an example)
2016-12-12 18:51:33 -08:00
Kubernetes Submit Queue 6c059cb9a1 Merge pull request #36169 from hpcloud/vsphere_bad_conditional
Automatic merge from submit-queue

Bad conditional in vSphereLogin function

```release-note
Fixes NotAuthenticated errors that appear in the kubelet and kube-controller-manager due to never logging in to vSphere
```

With this conditional being == instead of !=, a login would never actually be attempted by this provider, and disk attachments would fail with a NotAuthenticated error from vSphere.
2016-12-12 18:51:21 -08:00
Prashanth B 8ff3182fd4 Update OWNERS 2016-12-12 17:55:18 -08:00
Prashanth B 0eda833c31 Update OWNERS 2016-12-12 17:54:39 -08:00
Kubernetes Submit Queue 22db6c99a7 Merge pull request #38589 from runcom/fix-ImageStatus-comment
Automatic merge from submit-queue

CRI: fix ImageStatus comment

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

GRPC cannot encode `nil` (CRI-O itself panic while trying to encode `nil` for `ImageStatus`). This PR fixes `ImageStatus` comment to say that when the image does not exist the call returns a response having `Image` set to `nil` (instead of saying implementors should return `nil` directly).

/cc @mrunalp @vishh @feiskyer 

**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
```

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-12-12 17:30:11 -08:00
Antoine Pelisse 220daccfd7 Update OWNERS approvers and reviewers: pkg/runtime 2016-12-12 16:49:23 -08:00
Kubernetes Submit Queue 9ec6899594 Merge pull request #36115 from apelisse/owners-pkg-admission-
Automatic merge from submit-queue

Curating Owners: pkg/admission/

cc @lavalamp @davidopp @erictune @liggitt @derekwaynecarr

In an effort to expand the existing pool of reviewers and establish a
two-tiered review process (first someone lgtms and then someone
experienced in the project approves), we are adding new reviewers to
existing owners files.


If You Care About the Process:
------------------------------

We did this by algorithmically figuring out who’s contributed code to
the project and in what directories.  Unfortunately, that doesn’t work
well: people that have made mechanical code changes (e.g change the
copyright header across all directories) end up as reviewers in lots of
places.

Instead of using pure commit data, we generated an excessively large
list of reviewers and pruned based on all time commit data, recent
commit data and review data (number of PRs commented on).

At this point we have a decent list of reviewers, but it needs one last
pass for fine tuning.

TLDR:
-----

As an owner of a sig/directory and a leader of the project, here’s what
we need from you:

1. Use PR https://github.com/kubernetes/kubernetes/pull/35715 as an example.

2. Use the following commit as a suggestion: 7f6469fc41

3. The pull-request is made editable, please edit the `OWNERS` file to
add the names of people that should be reviewing code in the future in
the **reviewers** section. You probably do NOT need to modify the **approvers**
section.

4. Notify me if you want some OWNERS file to be removed.  Being an
approver or reviewer of a parent directory makes you a reviewer/approver
of the subdirectories too, so not all OWNERS files may be necessary.

5. Please use ALIAS if you want to use the same list of people over and
over again (don't hesitate to ask me for help, or use the pull-request
above as an example)
2016-12-12 15:57:25 -08:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Kubernetes Submit Queue f12eda8777 Merge pull request #38457 from resouer/fix-cgroup-cri
Automatic merge from submit-queue (batch tested with PRs 38419, 38457, 38607)

Fix pod level QoS does not works on CRI dockershim

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

We did set `CgroupParent ` in `CreateContainer`, but the `HostConfig.Resources` which `CgroupParent` belongs to is override by the following code:

```
hc.CgroupParent = lc.GetCgroupParent()

...

hc.Resources = dockercontainer.Resources{
	Memory:     rOpts.GetMemoryLimitInBytes(),
...
}
```

That's why `HostConfig.CgroupParent` is always empty and pod level QoS does not work.
2016-12-12 12:48:07 -08:00
Kubernetes Submit Queue 5e6578a734 Merge pull request #38419 from freehan/service-status-update
Automatic merge from submit-queue

bump log level on service status update

ref: https://github.com/kubernetes/kubernetes/issues/38349

I tried to reproduce the problem in #38349 and failed. Not sure why service status update failed and service controller skip status update in the next round. What I have observed is that if service status update failed due to conflict, the next round of processServiceUpdate will correct it. 

Bumping log level to get a better signal when it occurs.
2016-12-12 12:42:53 -08:00
Kubernetes Submit Queue 12147a3cd6 Merge pull request #38630 from ncdc/fix-threshold-notifier-build-tags
Automatic merge from submit-queue (batch tested with PRs 38453, 36672, 38629, 34966, 38630)

Fix threshold notifier build tags

Fix threshold notifier build tags so the linux version is only built if cgo is
enabled, and the unsupported version is built if it's either not linux or not
cgo.
2016-12-12 11:41:12 -08:00