Commit Graph

17609 Commits (46e5f2167667cba3c5c31b071aab7ff7d243ee6b)

Author SHA1 Message Date
Kubernetes Submit Queue 08342c1f3e Merge pull request #38825 from enj/enj/i/store_dead_code/38822
Automatic merge from submit-queue

Remove dead code in `pkg/registry/generic/registry/store.go`

Fixes #38822

Depending on the intent of the original code, the correct fix may instead be:

```go
if name, ok := p.MatchesSingle(); ok {
	key, err := e.KeyFunc(ctx, name)
	if err != nil {
		return nil, err
	}
	w, err := e.Storage.Watch(ctx, key, resourceVersion, p)
	if err != nil {
		return nil, err
	}
	if e.Decorator != nil {
		return newDecoratedWatcher(w, e.Decorator), nil
	}
	return w, nil
	// if we cannot extract a key based on the current context, the optimization is skipped
}
```

Signed-off-by: Monis Khan <mkhan@redhat.com>

cc @deads2k
2016-12-16 06:31:12 -08:00
Kubernetes Submit Queue de3b73bd43 Merge pull request #38826 from sttts/sttts-secret-routes-real-mux
Automatic merge from submit-queue

genericapiserver: turn APIContainer.SecretRoutes into a real ServeMux

The secret routes `Mux` is actually a `http.ServeMux` and we are type-casting to it. For downstream we want to wrap it into a restful container which also needs a real `http.ServeMux`.
2016-12-16 05:51:45 -08:00
Kubernetes Submit Queue 0d80ee0b8d Merge pull request #38767 from kargakis/fix-setting-container-name-in-create-deployment
Automatic merge from submit-queue

kubectl: fix 'create deployment' to set container name correctly

@kubernetes/kubectl @kubernetes/sig-cli
2016-12-16 04:38:22 -08:00
Kubernetes Submit Queue 5b240ca897 Merge pull request #36748 from kargakis/remove-events-from-deployment-tests
Automatic merge from submit-queue

Fix Recreate for Deployments and stop using events in e2e tests

Fixes https://github.com/kubernetes/kubernetes/issues/36453 by removing events from the deployment tests. The test about events during a Rolling deployment is redundant so I just removed it (we already have another test specifically for Rolling deployments).

Closes https://github.com/kubernetes/kubernetes/issues/32567 (preferred to use pod LISTs instead of a new status API field for replica sets that would add many more writes to replica sets).

@kubernetes/deployment
2016-12-16 03:57:02 -08:00
Dr. Stefan Schimanski e49fb2f1f4 genericapiserver: rename SecretRoutes -> UnlistedRoutes 2016-12-16 11:04:29 +01:00
Dr. Stefan Schimanski df7e711c0a genericapiserver: turn APIContainer.SecretRoutes into a real ServeMux 2016-12-16 09:18:18 +01:00
Kubernetes Submit Queue 87444522d0 Merge pull request #32088 from piosz/fluentd-daemon-set
Automatic merge from submit-queue

Migrated fluentd addon to daemon set

fix #23224
supersedes #23306 

``` release-note
Migrated fluentd addon to daemon set
```
2016-12-15 23:04:40 -08:00
Kubernetes Submit Queue e2a9fc1022 Merge pull request #38841 from mikedanese/fix-tests
Automatic merge from submit-queue

bazel: fix some unit tests
2016-12-15 20:19:46 -08:00
Mike Danese 8fdec87d19 bazel: fix some unit tests 2016-12-15 18:36:22 -08:00
Kubernetes Submit Queue 15059e6a5b Merge pull request #38839 from janetkuo/remove-GroupMeta-Codec
Automatic merge from submit-queue (batch tested with PRs 38842, 38839)

Remove GroupMeta.Codec

Fixes #21826
2016-12-15 18:08:15 -08:00
Kubernetes Submit Queue 7ca5f92b58 Merge pull request #38780 from mikedanese/ds-fix1
Automatic merge from submit-queue

daemonset: bail out after we enqueue once

This isn't terrible because we dedup in the queue but it's a waste of
cycles.
2016-12-15 16:15:52 -08:00
Kubernetes Submit Queue 8d71970dcd Merge pull request #36462 from mikedanese/discovery
Automatic merge from submit-queue

kubeadm: refactor discovery behind an interface

This adds support for alternative discovery methods using discovery urls. It is a breaking change. This is a WIP.

Example usage:
```
$ kubeadm init --discovery token://
$ kubeadm join --discovery token://c05de9:ab224260fb3cd718@192.168.0.1:6555,191.168.0.2:6443
$ kubeadm join --discovery file:///etc/kubernetes/cluster.json
$ kubeadm join --discovery https://storage.google.apis.com/kube-discovery/98ea6e4/kubeconfig.json
```

@kubernetes/sig-cluster-lifecycle
2016-12-15 15:35:26 -08:00
Kubernetes Submit Queue 845187b15a Merge pull request #38647 from deads2k/cli-14-factory
Automatic merge from submit-queue

make kubectl factory composeable

Alternate resolution of https://github.com/kubernetes/kubernetes/pull/38524.

Currently, the kubectl factory cannot be cleanly composed because without polymorphism, any calls which delegate to other factory methods cannot injected.  We cannot reasonably predict everything a composer would want to override, so enumeration of individual "we think this field is important" function is untenable.  On the other hand, having a method registry func and attaching methods to it resulted in chaos before 1.5 and the cleaner interface.

This pull takes the approach of building the factory in "rings" of subfactories.  RingN relies on RingN-1 and the overall factory is a set of nested factories.  No function in a "ring" is allowed to reference a peer function, but it may reference a parent ring's function.  This allows us to easily compose one chain for raw kube, but an extender can simply wrap a particular ring with his custom handling of particular functions and then continue the chain as normal.  This allows customization of each individual function.

It turns out that we have three rings.
 1. discovery, negotiation, and no-dep functions
 1. object typing and type mapping
 1. stuff that relies on type mapping (builder)

This pull does nothing split apart the dependencies.  No behavior changes.  There's more cleanup that could be done (particularly in naming), but I'd like to defer that to a later step.

@kubernetes/sig-cli @fabianofranz @AdoHe this is going to be a pain to rebase, so quick reviews are appreciated.
@ncdc @smarterclayton
2016-12-15 14:51:29 -08:00
Janet Kuo 05a1b3f5a0 Remove GroupMeta.Codec 2016-12-15 14:20:26 -08:00
Mike Danese 690c7e578b kubeadm: refactor discovery behind an interface 2016-12-15 13:54:49 -08:00
Kubernetes Submit Queue 6b72259320 Merge pull request #38823 from bprashanth/svc_error_eater
Automatic merge from submit-queue

Don't eat 403 in service controller

I haven't done a stress run of Services e2es locally yet, but I did verify that this fixes the specific "stuck in pending bug"
2016-12-15 12:33:55 -08:00
deads2k 50f6733800 make kubectl factory rings 2016-12-15 15:18:16 -05:00
Kubernetes Submit Queue 995f4ef2bf Merge pull request #38813 from deads2k/rbac-22-roles
Automatic merge from submit-queue (batch tested with PRs 38818, 38813, 38820)

update for controller RBAC roles

Role and binding updates from running e2e using RBAC during the tests in https://github.com/kubernetes/kubernetes/pull/38626

@sttts should be quick. No obvious typos.  Nothing that looks off.
2016-12-15 11:04:19 -08:00
Kubernetes Submit Queue 117e72aeb2 Merge pull request #38818 from jsafrane/aws-device-allocator
Automatic merge from submit-queue (batch tested with PRs 38818, 38813, 38820)

AWS: Add sequential allocator for device names.

On AWS, we should not reuse device names as long as possible, see https://aws.amazon.com/premiumsupport/knowledge-center/ebs-stuck-attaching/

> "If you specify a device name that is not in use by EC2, but is being used by the block device driver within the EC2 instance, the attachment of the EBS volume does not succeed and the EBS volume is stuck in the attaching state."

This patch adds a device name allocator that tries to find a name that's next to the last used device name instead of using the first available one. This way we will loop through all device names ("xvdba" .. "xvdzz") before a device name is reused.

Fixes: #31891

@wongma7, @gnufied, @childsb PTAL
2016-12-15 11:04:17 -08:00
Michail Kargakis 7ef3e6f7c9 controller: wait for all pods to be deleted before Recreating 2016-12-15 19:55:18 +01:00
Monis Khan 91cb57d904
Remove dead code
Signed-off-by: Monis Khan <mkhan@redhat.com>
2016-12-15 13:37:35 -05:00
bprashanth 98c7fe98e1 Don't eat 403 in service controller 2016-12-15 10:27:14 -08:00
Jan Safranek 65f6bcb927 AWS: Add sequential allocator for device names.
On AWS, we should not reuse device names as long as possible, see
https://aws.amazon.com/premiumsupport/knowledge-center/ebs-stuck-attaching/

"If you specify a device name that is not in use by EC2, but is being used by
the block device driver within the EC2 instance, the attachment of the EBS
volume does not succeed and the EBS volume is stuck in the attaching state."

This patch adds a device name allocator that tries to find a name that's next
to the last used device name instead of using the first available one.
This way we will loop through all device names ("xvdba" .. "xvdzz") before
a device name is reused.
2016-12-15 17:22:19 +01:00
Kubernetes Submit Queue cbbe421db8 Merge pull request #38757 from linki/patch-2
Automatic merge from submit-queue

fix typo in apiserver

Fixes a small typo I stumbled upon today.
2016-12-15 07:13:57 -08:00
deads2k 6ab6975983 update for controller RBAC roles 2016-12-15 09:18:48 -05:00
Kubernetes Submit Queue 1981a654a4 Merge pull request #38711 from wojtek-t/get_with_options_in_kubelet
Automatic merge from submit-queue (batch tested with PRs 38803, 38711)

Use Get from cache in apiserver in kubelet

Ref #37473
2016-12-15 05:56:17 -08:00
Piotr Szczesniak c00e57789d Added upgrade story from manifest pod to ds 2016-12-15 13:48:32 +01:00
Brendan Burns 43251c92e1 Add 'X-Content-Type-Options: nosniff" to some error messages 2016-12-14 22:01:43 -08:00
Kubernetes Submit Queue db867c0c9d Merge pull request #36396 from aveshagarwal/master-display-pod-node-selectors
Automatic merge from submit-queue (batch tested with PRs 38783, 36396)

Display pod node selectors with kubectl describe.

**What this PR does / why we need it**:
This PR fixes kubectl describe so that it now shows associated node selectors with pods.

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

```release-note
```

@kubernetes/rh-cluster-infra @kubernetes/kubectl
2016-12-14 17:54:52 -08:00
Kubernetes Submit Queue 3479522de5 Merge pull request #38701 from gmarek/routecontroller
Automatic merge from submit-queue (batch tested with PRs 38736, 38701)

Don't retry creating route if it already exists

Ref. #38618
2016-12-14 16:10:57 -08:00
Kubernetes Submit Queue 23cd9d7b05 Merge pull request #38736 from ixdy/build-tools-rename-back
Automatic merge from submit-queue

Rename root BUILD to BUILD.bazel, and rename build-tools/ back to build/

**What this PR does / why we need it**: undoes #35453. `build-tools/` was intended to be a temporary workaround until https://github.com/bazelbuild/bazel/issues/552 was fixed, which is has been, as of bazel 0.4.1.

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

FYI @thockin 

since this is likely to be rebase hell, my list of actions:
```console
$ git mv BUILD BUILD.bazel
$ git commit -a
$ git mv build-tools/ build/
$ sift -l 'build-tools' | xargs sed -i -e 's:build-tools/:build/:g'
$ git checkout HEAD docs/
$ git commit -a
```
2016-12-14 16:01:00 -08:00
Kubernetes Submit Queue 67d0f170b3 Merge pull request #34410 from yuexiao-wang/heathz-log
Automatic merge from submit-queue (batch tested with PRs 37708, 34410)

Fix some logs and commend information for healthz

Fix some logs which should be a lower case letter for the first letter and modify some commend information which is consistent in context.

Signed-off-by: yuexiao-wang wang.yuexiao@zte.com.cn
2016-12-14 15:09:53 -08:00
Kubernetes Submit Queue 4d467de5c5 Merge pull request #37708 from juanvallejo/jvallejo/add-restclient-config-helper-for-parsing-global-timeout
Automatic merge from submit-queue (batch tested with PRs 37708, 34410)

Add restclientconfig helper fn for parsing timeout

Related downstream PR: https://github.com/openshift/origin/pull/12062 (example of use-case for this patch)

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

This patch adds a package `pkg/client/unversioned/clientcmd/util` and
defines a `ParseTimeout` helper function for parsing time from a
user-defined string. This allows code re-use in other packages that
require the creation of a new restclient (and therefore must set the
`--global-timeout` flag value manually).

@fabianofranz @kubernetes/cli-review
2016-12-14 15:09:50 -08:00
Kubernetes Submit Queue f49442d433 Merge pull request #38502 from resouer/fix-wrong-comment
Automatic merge from submit-queue (batch tested with PRs 38154, 38502)

Wrong comment to describe docker version

The original comment about minimal docker version fo `room_score_adj` is wrong (though the code is right).

Really sorry for misleading :/
2016-12-14 14:21:53 -08:00
Kubernetes Submit Queue d8efc779ed Merge pull request #38154 from caesarxuchao/rename-release_1_5
Automatic merge from submit-queue (batch tested with PRs 38154, 38502)

Rename "release_1_5" clientset to just "clientset"

We used to keep multiple releases in the main repo. Now that [client-go](https://github.com/kubernetes/client-go) does the versioning, there is no need to keep releases in the main repo. This PR renames the "release_1_5" clientset to just "clientset", clientset development will be done in this directory.

@kubernetes/sig-api-machinery @deads2k 

```release-note
The main repository does not keep multiple releases of clientsets anymore. Please find previous releases at https://github.com/kubernetes/client-go
```
2016-12-14 14:21:51 -08:00
Jeff Grafton 27d096d27d Rename build-tools/ back to build/ 2016-12-14 13:42:15 -08:00
Mike Danese 3a311a2bc2 daemonset: bail out after we enqueue once
This isn't terrible because we dedup in the queue but it's a waste of
cycles.
2016-12-14 12:59:06 -08:00
Chao Xu 6709b7ada2 run hack/update-codegen.sh
run hack/verify-gofmt.sh
update bazel
2016-12-14 12:39:49 -08:00
Chao Xu 28c2ed2c8d manually update import_known_versions.go 2016-12-14 12:39:49 -08:00
Chao Xu 03d8820edc rename /release_1_5 to /clientset 2016-12-14 12:39:48 -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
Michail Kargakis bf78c00a96 kubectl: fix 'create deployment' to set container name correctly 2016-12-14 17:32:33 +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
Martin Linkhorst 37f4e8d2b8 fix(apiserver): fix typo in apiserver 2016-12-14 14:27:40 +01:00