Commit Graph

799 Commits (becd626c8e63a967c8efaf4bedd957caaed37e91)

Author SHA1 Message Date
Kubernetes Submit Queue 7e42d3848e Merge pull request #44492 from CaoShuFeng/namer
Automatic merge from submit-queue (batch tested with PRs 44837, 44779, 44492)

remove duplicate code from restful namer

The deleted codes have the same logic with function ObjectName.

**Release note**:

```release-note
```
2017-04-24 07:56:02 -07:00
Kubernetes Submit Queue c90faa8071 Merge pull request #44779 from enj/enj/r/etcd_default_name_copy
Automatic merge from submit-queue (batch tested with PRs 44837, 44779, 44492)

Default ObjectNameFunc for all REST Stores

All `Store`s in Kubernetes follow the same logic for determining the name of an object.  This change makes it so that `CompleteWithOptions` defaults the `ObjectNameFunc` if it is not specified.  Thus a user does not need to remember to use `ObjectMeta.Name`.  Using the wrong field as the name can lead to an object which has a name that bypasses normal object name validation.

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

cc @liggitt @soltysh for review

**Release note**:

```
NONE
```
2017-04-24 07:55:59 -07:00
Kubernetes Submit Queue 08c5e28904 Merge pull request #44837 from danielqsj/apiissue
Automatic merge from submit-queue

Fix Content-Type error of apis

**What this PR does / why we need it**:
Response's Content-type of `/apis` is `text/plain`, not `application/json`.

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

**Special notes for your reviewer**:
We could use `responsewriters.WriteObjectNegotiated()` to write Content-type correctly.

**Release note**:

```release-note
```
2017-04-24 07:14:33 -07:00
Kubernetes Submit Queue 57fdd75cb8 Merge pull request #43440 from CaoShuFeng/audit_port
Automatic merge from submit-queue

Update basic audit filter's comment message

**Release note**:

```NONE
```
2017-04-24 06:27:59 -07:00
shijunqian 90802b2e3d Fix Content-Type error of apis 2017-04-24 16:12:00 +08:00
Kubernetes Submit Queue ac90c0e45c Merge pull request #44579 from mikedanese/cert-fix
Automatic merge from submit-queue

make certs used in roundtripper_test same as those used in proxy_test

This fixes an invalid cert error in 1.8. Gross copy paste but we will likely never have to do this again.

Part of https://github.com/kubernetes/kubernetes/issues/38228

https://github.com/kubernetes/kubernetes/blame/master/staging/src/k8s.io/apiserver/pkg/endpoints/proxy_test.go#L524-L570
2017-04-23 22:23:36 -07:00
Kubernetes Submit Queue e0ba40b67c Merge pull request #39716 from zhouhaibing089/etcd-health-check
Automatic merge from submit-queue

etcd component status check should include credentials

- [x] Add TLS credentials into `pkg/genericapiserver.Backend`.
- [x] Add TLS credentials into `pkg/registry/core/componentstatus.Server`.
- [x] `pkg/probe/http.httpProber` should accept the TLS credentials.

Now it is working.

```console
$ kubectl get cs
NAME                 STATUS    MESSAGE              ERROR
scheduler            Healthy   ok
controller-manager   Healthy   ok
etcd-0               Healthy   {"health": "true"}
```

Fixes https://github.com/kubernetes/kubernetes/issues/27343.
2017-04-22 07:30:30 -07:00
Kubernetes Submit Queue fa750c02be Merge pull request #44570 from liggitt/namespace-icc
Automatic merge from submit-queue

Explicit namespace from kubeconfig should override in-cluster config

Fixes #43662 

If an explicitly specified namespace is read from a kubeconfig file, we should not fall back to in-cluster config

```release-note
kubectl commands run inside a pod using a kubeconfig file now use the namespace specified in the kubeconfig file, instead of using the pod namespace. If no kubeconfig file is used, or the kubeconfig does not specify a namespace, the pod namespace is still used as a fallback.
```
2017-04-21 14:45:23 -07:00
Monis Khan ed35deb69d
Default ObjectNameFunc for all REST Stores
All Stores in Kubernetes follow the same logic for determining the name
of an object.  This change makes it so that CompleteWithOptions defaults
the ObjectNameFunc if it is not specified.  Thus a user does not need to
remember to use ObjectMeta.Name.  Using the wrong field as the name can
lead to an object which has a name that bypasses normal object name
validation.

Signed-off-by: Monis Khan <mkhan@redhat.com>
2017-04-21 15:47:25 -04:00
Kubernetes Submit Queue ee86c18d92 Merge pull request #44623 from p0lyn0mial/split_out_admission_options
Automatic merge from submit-queue (batch tested with PRs 42202, 40784, 44642, 44623, 44761)

Split out AdmissionOptions

**What this PR does / why we need it**: The changes in this PR split out AdmissionOptions from ServerRunOptions. In the long term AdmissionOptions will accepts various dependencies
and spit out AdmissionControl

**Release note**:

NONE
2017-04-21 11:52:09 -07:00
Kubernetes Submit Queue 936137d22b Merge pull request #44076 from liggitt/impersonation-groupify
Automatic merge from submit-queue

Include system:authenticated group when impersonating

Fixes #43227

An authorized impersonation request solely for a specific username previously resulted in a `user.Info` that did not include either the `system:authenticated` or `system:unauthenticated` groups. That meant that permissions intended to be granted to all users, like discovery, would be denied the impersonated user.

This allows `kubectl get pods --as=<username>` to work as expected

```release-note
API requests using impersonation now include the `system:authenticated` group in the impersonated user automatically.
```
2017-04-21 09:22:35 -07:00
Kubernetes Submit Queue c4bc7c1166 Merge pull request #44636 from yvespp/master
Automatic merge from submit-queue

client-go PortForwarder: don't log an error if net.Listen fails

**What this PR does / why we need it**:
If ipv6 is disabled the client-go PortForwarder logs an error:
```
E0406 17:26:06.983609   29625 portforward.go:209] Unable to create listener: Error listen tcp6 [::1]:30143: socket: address family not supported by protocol
```
This pull request removes this error log. Reasons:
* Tunnel creation might still succeed on ipv4 and the error just confuses the user (see https://github.com/kubernetes/helm/issues/2223).
* If the tunnel can't be created the error gets also loggen in `listenOnPort`.
* runtime.HandleError should only be used on errors "_when a non-user facing piece of code cannot return an error"_ which isn't the case here.

**Which issue this PR fixes**
Fixes https://github.com/kubernetes/helm/issues/2223
2017-04-21 08:34:17 -07:00
Kubernetes Submit Queue 3559c067c6 Merge pull request #41571 from php-coder/fix_comments
Automatic merge from submit-queue

Minor cleanups

Minor improvements:
- `ValidateNoNewFinalizers`: remove unused const
- Mention that mutation of `spec.initContainers[*].image` field is allowed
- Improve godoc comments
2017-04-21 08:34:07 -07:00
Roman Mohr b39b3ba016 client-go workqueue example
Demonstrates how to compose a controller out of cache.Controller,
cache.Indexer and a workqueue.
2017-04-21 12:41:30 +02:00
Kubernetes Submit Queue 870585e8e1 Merge pull request #44651 from knightXun/string
Automatic merge from submit-queue (batch tested with PRs 44594, 44651)

remove strings.compare(), use string native operation

I notice we use strings.Compare() in some code, we can remove it and use native operation.
2017-04-20 14:08:59 -07:00
Kubernetes Submit Queue 7b43f922aa Merge pull request #42176 from enisoc/controller-ref-job
Automatic merge from submit-queue (batch tested with PRs 42177, 42176, 44721)

Job: Respect ControllerRef

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

This is part of the completion of the [ControllerRef](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/controller-ref.md) proposal. It brings Job into full compliance with ControllerRef. See the individual commit messages for details.

**Which issue this PR fixes**:

This ensures that Job does not fight with other controllers over control of Pods.

Ref: #24433

**Special notes for your reviewer**:

**Release note**:

```release-note
Job controller now respects ControllerRef to avoid fighting over Pods.
```
cc @erictune @kubernetes/sig-apps-pr-reviews
2017-04-20 12:57:06 -07:00
Jordan Liggitt 63b5650885
Explicit namespace from kubeconfig should override in-cluster config 2017-04-20 13:46:23 -04:00
Jordan Liggitt 67360883bc
Switch to pointer to policy rule, visit and short circuit during authorization 2017-04-20 10:52:53 -04:00
Cao Shufeng 939b962975 refactor code from restful namer
Some codes are replaced because they will never run.
2017-04-20 17:34:08 +08:00
Kubernetes Submit Queue afc01d92d2 Merge pull request #42272 from marun/apiserver-fail-fast
Automatic merge from submit-queue

apiserver: Update genericapiserver to panic on listener error

Previously runServer would try to listen again if a listener error occurred.  This commit changes the response to a panic to allow a process manager (systemd/kubelet/etc) to react to the failure.

**Release note**:

```release-note
The Kubernetes API server now exits if it encounters a networking failure (e.g. the networking interface hosting its address goes away) to allow a process manager (systemd/kubelet/etc) to react to the problem.  Previously the server would log the failure and try again to bind to its configured address:port.
```

cc: @liggitt @sttts @deads2k @derekwaynecarr
2017-04-19 23:51:34 -07:00
Anthony Yeh ad026026e0 Job: Update Lister documentation for ControllerRef.
The Job Listers still use selectors, because this is the
behavior expected by callers. This clarifies the meaning of the
returned list. Some callers may need to switch to using
GetControllerOf() instead, but that is a separate, case-by-case issue.
2017-04-19 14:03:36 -07:00
p0lyn0mial 4a3dcff3bf bazel update 2017-04-19 17:22:44 +02:00
Kubernetes Submit Queue d46983f2e5 Merge pull request #44667 from gmarek/fix_get_traces
Automatic merge from submit-queue

Fix traces for get requests

Currently traces for GETs are not useful at all, as they're measuring the wrong thing.
2017-04-19 08:06:41 -07:00
gmarek 2a49281b55 Fix traces for get requests 2017-04-19 15:04:03 +02:00
Kubernetes Submit Queue 712ccf3fa4 Merge pull request #44082 from zetaab/fixzone2
Automatic merge from submit-queue

use availability_zone instead of availability (update godep for gophercloud)

**What this PR does / why we need it**: there is typo in json variable name

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

**Special notes for your reviewer**:our openstack environment region name is not nova, so I tested this and it works now

All cinder blockstorages are using variable name availability_zone instead of availability. Docs: 

v3:
https://developer.openstack.org/api-ref/block-storage/v3/index.html?expanded=create-a-volume-detail#create-a-volume

v2:
https://developer.openstack.org/api-ref/block-storage/v2/index.html?expanded=create-volume-detail#create-volume

I could not find v1 documentation anymore from openstack pages. However, https://developer.rackspace.com/docs/cloud-block-storage/v1/api-reference/cbs-volumes-operations/#create-a-volume documentation says also availability_zone is the correct one. 

Like mentioned in https://github.com/kubernetes/kubernetes/issues/44032#issuecomment-291488494 openstack CLI is using availability_zone
2017-04-19 03:26:25 -07:00
xu fei b0a3f492af remove strings.compare(), use string native operation 2017-04-19 09:32:29 +08:00
Maru Newby 30fb3be4d2 apiserver: Update genericapiserver to panic on listener error
Previously runServer would try to listen again if a listener error
occurred.  This commit changes the response to a panic to allow a
process manager (systemd/kubelet/etc) to react to the failure.
2017-04-18 15:48:45 -07:00
Yves Peter 99711a96a4 client-go PortForwarder: don't log an error if net.Listen fails 2017-04-18 22:46:32 +02:00
p0lyn0mial de9706bc15 Split out AdmissionOptions
In the long term AdmissionOptions will accepts various dependencies
and spit out AdmissionControl
2017-04-18 19:48:14 +02:00
Kubernetes Submit Queue eccba3b6d0 Merge pull request #42711 from xilabao/small-fix-in-audit-log
Automatic merge from submit-queue

clean auditStringSlice in audit
2017-04-18 03:03:21 -07:00
Kubernetes Submit Queue f40fafe755 Merge pull request #44568 from mikedanese/fix-staging
Automatic merge from submit-queue (batch tested with PRs 40055, 42085, 44509, 44568, 43956)

revert BUILD changes at the end of DRY_RUN=n copy.sh

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

cc @caesarxuchao @ixdy @spxtr
2017-04-17 15:39:11 -07:00
Kubernetes Submit Queue a1684fea80 Merge pull request #42085 from cblecker/gofmt-fix
Automatic merge from submit-queue (batch tested with PRs 40055, 42085, 44509, 44568, 43956)

Fix gofmt errors

**What this PR does / why we need it**:
There were some gofmt errors on master. Ran the following to fix:
```
hack/verify-gofmt.sh | grep ^diff | awk '{ print $2 }' | xargs gofmt -w -s
```

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-04-17 15:39:07 -07:00
Kubernetes Submit Queue 44127c588d Merge pull request #40055 from StudyNick/zte-20170118
Automatic merge from submit-queue

error word

dummyController Struct comment "disonnected " is error word
WaitForCacheSync method comment "contoller" is error word
2017-04-17 15:30:17 -07:00
Mike Danese ceb0b4e799 make certs used in roundtripper_test same as those used in proxy_test 2017-04-17 14:37:40 -07:00
Kubernetes Submit Queue 73fb978181 Merge pull request #44398 from caesarxuchao/move-v1/refs-and-v1/resource
Automatic merge from submit-queue (batch tested with PRs 44569, 44398)

Move v1/refs and v1/resource

This PR moves pkg/api/v1/ref.go and pkg/api/v1/resource_helper.go to their own sub packages, it's very similar to 44299 and 44302.

The PR is mostly mechanical, except that 
* i moved some utility function from resource.go to pkg/api/v1/pod and pkg/api/v1/node, as they are more appropriate
* i updated the staging/copy.sh to copy the new subpackages, so that helper functions are copied. We can get rid of this copy after client-go stops copying API types.
2017-04-17 14:03:57 -07:00
Kubernetes Submit Queue 4372b437ba Merge pull request #44513 from mml/windows
Automatic merge from submit-queue (batch tested with PRs 44519, 43194, 44513)

Use regexp instead of substring to do search and replace.

enisoc pointed out how ToLower can change (lengthen even!) the length of
a string given arbitrary input.

Follow-up to #44421 for #44419
2017-04-17 12:39:06 -07:00
Kubernetes Submit Queue ca8f1bcf3d Merge pull request #44519 from thockin/remove-deprecated-public-ips
Automatic merge from submit-queue

Remove deprecatedPublicIPs field
2017-04-17 12:11:00 -07:00
Chao Xu 4f9591b1de move pkg/api/v1/ref.go and pkg/api/v1/resource.go to subpackages. move some functions in resource.go to pkg/api/v1/node and pkg/api/v1/pod 2017-04-17 11:38:11 -07:00
Mike Danese 4eb5498bc7 run update-bazel.sh at the end of DRY_RUN=n copy.sh 2017-04-17 11:27:21 -07:00
Kubernetes Submit Queue 74d0258818 Merge pull request #44373 from knightXun/patch-2
Automatic merge from submit-queue

change event count type

event count type had better to be uint.

thx all.
2017-04-17 01:33:57 -07:00
zhouhaibing089 b1040171b6 componentstatus: support client cert health check
etcd has support for client-cert-auth, which can be configured via the flag `--ca-file`,
when that is enabled, all the client requests must present with a client certificate,
however, the current component status check uses a single transport for all of the checks,
this is wrong, the checks should be different for each of different component, and make
each of them use different transport(tls configurations).
2017-04-17 13:58:33 +08:00
xilabao 4b8abd811d remove useless check in audit.go 2017-04-17 09:58:19 +08:00
Tim Hockin fa93290b72 --amend 2017-04-16 13:06:01 -07:00
Kubernetes Submit Queue dee81ed56a Merge pull request #44113 from mikkeloscar/update-goproxy
Automatic merge from submit-queue

vendor: Update elazarl/goproxy to fix e2e test with go1.8

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

This updates the dependency `github.com/elazarl/goproxy` to include this fix c4fc26588b which makes kubernetes e2e tests build with go1.8. It was crashing before as described in https://github.com/elazarl/goproxy/issues/188#issuecomment-281092250 and #38228

**Which issue this PR fixes**

This is part of the fix for #38228 

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-04-16 10:26:55 -07:00
Kubernetes Submit Queue f05ce1e8f1 Merge pull request #44423 from monopole/fixUserAgent
Automatic merge from submit-queue

Use OS-specific libs when computing client User-Agent in kubectl, etc.

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

The User-Agent reported by clients (e.g. kubectl) in request
headers should include the name of the client executable
but not the full path to that executable.

This PR changes how this name is determined by using the
operating-system specific package "path/filepath" (meant for
working with file system paths) instead of the "path" package
(meant for URL paths).

This fixes a problem on the Windows OS in the case where, if the
user has not set their PATH to point to the location of their
client executable, the User-Agent includes the full path - which
is unnecessary.

Fixes: #44419

```release-note
Use OS-specific libs when computing client User-Agent in kubectl, etc.
```
2017-04-14 18:14:16 -07:00
Jeffrey Regan 04f993250b Use OS-specific libs when computing client User-Agent.
**What this PR does / why we need it**:

The User-Agent reported by clients (e.g. kubectl) in request
headers should include the name of the client executable
but not the full path to that executable.

This PR changes how this name is determined by using the
operating-system specific package "path/filepath" (meant for
working with file system paths) instead of the "path" package
(meant for URL paths).

This fixes a problem on the Windows OS in the case where, if the
user has not set their PATH to point to the location of their
client executable, the User-Agent unnecessarily includes the
full path.

Fixes: #44419
2017-04-14 16:06:11 -07:00
Chao Xu d4850b6c2b move pkg/api/v1/helpers.go to subpackage 2017-04-14 14:25:11 -07:00
Matt Liggett fe202fcfc4 Use regexp instead of substring to do search and replace.
enisoc pointed out how ToLower can change (lengthen even!) the length of
a string given arbitrary input.
2017-04-14 14:25:02 -07:00
Mike Danese bd23931aeb ignore BUILD files in staging 2017-04-14 10:41:02 -07:00
Mike Danese 981dd8dc66 add testdata for tests in //vendor/k8s.io/... 2017-04-14 10:41:02 -07:00