Commit Graph

2760 Commits (331c52c0fd4890ce999bad29265600d16cbb7abd)

Author SHA1 Message Date
Dr. Stefan Schimanski 74b4223ab8 admission: complete plumbing of validation admission 2017-11-02 08:45:41 +01:00
Dr. Stefan Schimanski d4f48c9313 admission: split MutationInterface out of Interface 2017-11-02 08:45:41 +01:00
Dr. Stefan Schimanski 970d2553cc admission: { -> Mutating}Admit(admission.Attributes) 2017-11-02 08:45:41 +01:00
David Eads 02e16cb253 add wiring for validating admission 2017-11-02 08:45:41 +01:00
Kubernetes Submit Queue c3f31376da
Merge pull request #51940 from atlassian/unstructured-helpers
Automatic merge from submit-queue (batch tested with PRs 54787, 51940). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Useful helper functions for Unstructured

**Which issue this PR fixes**:
Fixes #40790

**Release note**:
```release-note
NONE
```
/kind feature
/sig api-machinery
/area client-libraries
/assign @sttts @liggitt
2017-11-02 00:43:17 -07:00
Clayton Coleman 3ec453d0d0
When cert dir is relative, cert rotation builds incorrect symlinks
Symlinks relative to a working directory were being constructed to the
wrong location, leading to failure to refresh client certs.
2017-11-02 00:34:34 -04:00
tengqm 325f573804 Improve deleteOptions doc 2017-11-02 11:48:40 +08:00
Kubernetes Submit Queue 816f2f4605
Merge pull request #53048 from kubermatic/log-healthz-check-fail
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Log error when a healthz check fails

**What this PR does / why we need it**:
Currently we only tell a user that a healthz check failed but we don't display the explicit error of the failed check. This is fine, but we should log the error to make debugging easier.

```release-note
Log error of failed healthz check
```
2017-11-01 07:27:09 -07:00
Nikhita Raghunath 79349c93bd Fix error for strategic merge patch of custom resources
We need the go struct tags `patchMergeKey` and `patchStrategy`
for fields that support a strategic merge patch. For native
resources, we can easily figure out these tags since we know
the fields.

Because custom resources are decoded as Unstructured and
because we're missing the metadata about how to handle
each field in a strategic merge patch, we can't find the
go struct tags. Hence, we can't easily  do a strategic merge
for custom resources.

So we should fail fast and return an error.
2017-11-01 18:42:11 +05:30
Mikhail Mazurskiy 7c10cbc642
Useful helper functions for Unstructured 2017-11-01 21:04:35 +11:00
Mikhail Mazurskiy 7aeaedd721
Split unstructured.go into several parts
No functional changes
2017-11-01 20:51:30 +11:00
Wei Wei bca495e229 rename metric reflector_xx_last_resource_version to reflector_last_resource_version{name="xx"} 2017-11-01 16:34:18 +08:00
tengqm d87f3c6cc1 Improve cronjob concurrency policy doc 2017-11-01 14:55:46 +08:00
Kubernetes Submit Queue 7fdacaa6bf
Merge pull request #54801 from apelisse/fix-broken-truncate
Automatic merge from submit-queue (batch tested with PRs 53190, 54790, 54445, 52607, 54801). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update `truncateBody` to not truncate with high level

And add a unit-tests to verify that it works properly.

**What this PR does / why we need it**:
Update `truncateBody` so that one can use `V(10)` to read the entire content of a HTTP response.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-10-31 20:10:27 -07:00
Kubernetes Submit Queue ed00d9c062
Merge pull request #54445 from crimsonfaith91/rem
Automatic merge from submit-queue (batch tested with PRs 53190, 54790, 54445, 52607, 54801). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove created-by annotation

**What this PR does / why we need it**:
This PR removes `CreatedByAnnotation`.

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

**Release note**:

```release-note
The `kubernetes.io/created-by` annotation is no longer added to controller-created objects. Use the  `metadata.ownerReferences` item that has `controller` set to `true` to determine which controller, if any, owns an object.
```
2017-10-31 20:10:21 -07:00
Antoine Pelisse a63ecc4a92 Update `truncateBody` to not truncate with high level
And add a unit-tests to verify that it works properly.
2017-10-31 09:40:31 -07:00
Kubernetes Submit Queue 7a944a69d6
Merge pull request #54485 from sttts/sttts-unify-admission-constructors
Automatic merge from submit-queue (batch tested with PRs 54761, 54748, 53991, 54485, 46951). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

admission: unify plugin constructors

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

Note: super interfaces do not work if there are overlapping methods.
2017-10-30 15:38:33 -07:00
Kubernetes Submit Queue 2a4c9be419
Merge pull request #53991 from sttts/sttts-no-api-scheme
Automatic merge from submit-queue (batch tested with PRs 54761, 54748, 53991, 54485, 46951). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Cosmetical cleanup after pkg/api/legacyscheme move

Follow-up of https://github.com/kubernetes/kubernetes/pull/53984

- Fix and update comment with api.Scheme
- Remove all api.Scheme references by using explicit package aliases
2017-10-30 15:38:30 -07:00
Kubernetes Submit Queue cdc92e1269
Merge pull request #54748 from xiangpengzhao/fix-const
Automatic merge from submit-queue (batch tested with PRs 54761, 54748, 53991, 54485, 46951). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make HugePages const name consistent.

**What this PR does / why we need it**:
Make HugePages const name in v1 be consistent with the name in api.
f9e6142f92/pkg/api/types.go (L686)

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-30 15:38:27 -07:00
Michael Taufen 7cb21746c0 Lift embedded structure out of ManifestURLHeader field 2017-10-30 15:37:55 -07:00
Kubernetes Submit Queue d7567cd6c7
Merge pull request #54704 from dims/try-clean-up-stores
Automatic merge from submit-queue (batch tested with PRs 53796, 54666, 54516, 54625, 54704). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix TestCRD Flake

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

The DestroyFunc functions returned by generic.NewRawStorage is never
called when we do a StartTestServer() in the test suite. For a quick
hack for now, added TrackStorageCleanup/RegisterStorageCleanup and
CleanupStorage. Note that unless TrackStorageCleanup is called (which
is called only from the test suite) the other two methods are
no-ops essentially. So no change in behavior at runtime. This vastly
brings down the number of goroutines that are left behind when this
test is executed and should reduce if not eliminate the flakiness
of TestCRD

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-30 13:48:41 -07:00
Jun Xiang Tee efbfead4ef remove created-by annotation 2017-10-30 12:49:44 -07:00
Kubernetes Submit Queue 0c1f25fc1b
Merge pull request #54683 from liggitt/subresource-gvk
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix subresource discovery and versioning

Fixes https://github.com/kubernetes/kubernetes/issues/54684
Related to https://github.com/kubernetes/kubernetes/pull/54586

Allows distinct subresource group/version/kind to be used for each version (gives us a path to move to autoscaling/v1 for apps, or policy/v1 for eviction, etc)

Added tests to ensure scale subresources have expected discovery info, and that the object returned matches discovery, and that the endpoint accepts the advertised version

```release-note
Fixes discovery information for scale subresources in the apps API group
```
2017-10-30 11:57:18 -07:00
Dr. Stefan Schimanski 2b201ead11 Fix and update comment with api.Scheme 2017-10-30 19:54:02 +01:00
Dr. Stefan Schimanski 131905cdb8 admission: unify plugin constructors 2017-10-30 16:56:38 +01:00
Dr. Stefan Schimanski f6a89df3fb Revert "audit backend run shutdown gracefully after http handler finish"
This reverts commit f42686081b.
2017-10-30 15:26:51 +01:00
Kubernetes Submit Queue 6659f2a7d8
Merge pull request #54477 from nikhita/invalid-patch-code
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiserver: return 4xx for invalid patch

Fixes #54423 

Currently, an invalid patch returns 500. The apiserver should return a 400 (`BadRequest`) or 422 (`Unprocessable Entity`).

**Release note**:

```release-note
NONE
```
2017-10-30 03:30:56 -07:00
Nikhita Raghunath e0a2168ecb apiserver: return 4xx for invalid patch
Add interpretPatchError to return appropriate http code
(400 or 422) according to the error type.

We add this function in apiserver because we don't want
to mention the http code in apimachinery. The apimachinery
code is also used in kubectl. The client should not return
a server error.

Add a test to validate the http error code and error message.
2017-10-30 10:40:51 +05:30
hzxuzhonghu fcf4a0e191 fix import warning 2017-10-30 10:16:13 +08:00
Kubernetes Submit Queue 12e5db561e
Merge pull request #53768 from smarterclayton/chunking_cli
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Support api chunking in kubectl get

This enables chunking in the resource builder to make it easy to
retrieve resources in pages and visit partial result sets. This adds
`--chunk-size` to `kubectl get` only so that users can get comfortable
with the use of chunking in beta. Future changes will enable chunking
for all CLI commands so that bulk actions can be performed more
efficiently.

```
$ kubectl get pods --all-namespaces
... print batch of 500 pods ...
... print second batch of 500 pods ...
...
```

@kubernetes/sig-cli-pr-reviews @kubernetes/sig-api-machinery-pr-reviews

```release-note
`kubectl get` will by default fetch large lists of resources in chunks of up to 500 items rather than requesting all resources up front from the server. This reduces the perceived latency of managing large clusters since the server returns the first set of results to the client much more quickly.  A new flag `--chunk-size=SIZE` may be used to alter the number of items or disable this feature when `0` is passed.  This is a beta feature.
```
2017-10-29 15:59:54 -07:00
Davanum Srinivas 00bcbd1311 Fix TestCRD Flake
The DestroyFunc functions returned by generic.NewRawStorage is never
called when we do a StartTestServer() in the test suite. For a quick
hack for now, added TrackStorageCleanup/RegisterStorageCleanup and
CleanupStorage. Note that unless TrackStorageCleanup is called (which
is called only from the test suite) the other two methods are
no-ops essentially. So no change in behavior at runtime. This vastly
brings down the number of goroutines that are left behind when this
test is executed and should reduce if not eliminate the flakiness
of TestCRD
2017-10-29 09:50:12 -04:00
Kubernetes Submit Queue 7a6a58f444
Merge pull request #53695 from hzxuzhonghu/audit-graceful-shutdown
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Shutdown http handlers before shutting down audit backend

**What this PR does / why we need it**:
Currently, audit backend is shut down before http handlers stop processing requests, so some audit events can be dropped in case of batching webhook.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Shutdown http handlers in kube-apiserver before shutting down audit backend.
```
2017-10-28 03:33:54 -07:00
xiangpengzhao 7e66ca584f Make HugePages const name consistent. 2017-10-28 15:41:10 +08:00
hzxuzhonghu f42686081b audit backend run shutdown gracefully after http handler finish 2017-10-28 15:03:38 +08:00
Jordan Liggitt 5913fccada
Use GVK from storage in API registration 2017-10-27 23:57:39 -04:00
Jordan Liggitt 729a0da155
Specify correct subresource discovery info 2017-10-27 23:57:38 -04:00
Chao Xu 88cb71c421 Add a e2e test for the admission webhook 2017-10-27 15:58:23 -07:00
Clayton Coleman 4780ad0297
Support api chunking in kubectl get
This enables chunking in the resource builder to make it easy to
retrieve resources in pages and visit partial result sets. This adds
`--chunk-size` to `kubectl get` only so that users can get comfortable
with the use of chunking in beta. Future changes will enable chunking
for all CLI commands so that bulk actions can be performed more
efficiently.
2017-10-27 17:23:36 -04:00
Chao Xu ca8131877a remove the nesting directory webhook/webhook 2017-10-27 10:09:46 -07:00
Kevin 4c8539cece use core client with explicit version globally 2017-10-27 15:48:32 +08:00
Kubernetes Submit Queue 9ec88d0d45 Merge pull request #54513 from deads2k/admission-09-move
Automatic merge from submit-queue (batch tested with PRs 49865, 53731, 54013, 54513, 51502). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 move webhook admission to generic apiserver

This builds on https://github.com/kubernetes/kubernetes/pull/54414.

It moves the admission webhook into the generic apiserver.  It also allows the injection of a server managed way to override the rest.Config used for a particular service.  This makes for an easier point to allow auto-configuration of the kube-apiserver to loopback to itself as a special case for kubernetes.default.svc.

@kubernetes/sig-api-machinery-pr-reviews 

```release-note
the generic admission webhook is now available in the generic apiserver
```
2017-10-26 13:24:39 -07:00
Kubernetes Submit Queue 7d5dc528a0 Merge pull request #54013 from vladimirvivien/scaleio-secret-multi-tenancy
Automatic merge from submit-queue (batch tested with PRs 49865, 53731, 54013, 54513, 51502). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

ScaleIO - Ability to specify Secret's name and namespace 

**What this PR does / why we need it**:
This PR is to decouple the ScaleIO secret from the same namespace as that of the StorageClass/PVC/PV that uses it (#53619). Currently, authorized non-admin k8s user, who creates volumes, may end up having unauthorized access to ScaleIO secret information.  This PR introduces secret parameter that allows specification of secret's namespace.

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

**Release note**:
```release-note
ScaleIO persistent volumes now support referencing a secret in a namespace other than the bound persistent volume claim's namespace; this is controlled during provisioning with the `secretNamespace` storage class parameter; StoragePool and ProtectionDomain attributes no longer defaults to the value `default`
```
2017-10-26 13:24:34 -07:00
Kubernetes Submit Queue d52c708b90 Merge pull request #53173 from alrs/fix-strategicpatch-swallowed-errors
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix strategicpatch swallowed errors

**What this PR does / why we need it**: Fixes four dropped error variables in `apimachinery`.

```release-note NONE
```
2017-10-26 11:46:55 -07:00
David Eads 8c1fe1f61a move webhook admission to generic apiserver 2017-10-26 07:45:49 -04:00
Kubernetes Submit Queue 58fd063a6c Merge pull request #54594 from tamalsaha/log-o
Automatic merge from submit-queue (batch tested with PRs 54081, 54271, 51783, 54600, 54594). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add go flags to go-to-protobuf

Reopened from code-generator repo.

cc: @sttts
2017-10-26 02:43:55 -07:00
Kubernetes Submit Queue 3f5f9c3df9 Merge pull request #54600 from marun/enable-federation-vendoring
Automatic merge from submit-queue (batch tested with PRs 54081, 54271, 51783, 54600, 54594). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update to latest kube-openapi and kazel

- update vendored kube-openapi to include https://github.com/kubernetes/kube-openapi/pull/14
 - update hash of repo infra used for bazel generation so kazel includes https://github.com/kubernetes/repo-infra/pull/48

This is the final step in enabling federation to generate openapi code for itself and vendored kube (#54335).

/sig multicluster testing
2017-10-26 02:43:51 -07:00
Kubernetes Submit Queue 52d87de107 Merge pull request #54237 from lichuqiang/apimachinery_fix
Automatic merge from submit-queue (batch tested with PRs 52717, 54568, 54452, 53997, 54237). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix bug in func OnError() of apimachinery in case time moves backwards for any reason

**What this PR does / why we need it**:
in func OnError() of ErrorHandlers in apimachinery
```
func (r *rudimentaryErrorBackoff) OnError(error) {
	r.lastErrorTimeLock.Lock()
	defer r.lastErrorTimeLock.Unlock()
	d := time.Since(r.lastErrorTime)
	if d < 0 {
		time.Sleep(r.minPeriod - d)
	}
	r.lastErrorTime = time.Now()
}
```
it is expected to go on sleep for some time if not meet the minPeriod. However, if time happens hops to the past in the process. `d := time.Since(r.lastErrorTime)` would be a negative number, thus, it may sleep a lot longer than we expected.

The period for sleep should be reseted if time hops

**Which issue this PR fixes**
 fixes #54236


**Release note**:

```release-note
NONE
```
2017-10-25 23:10:42 -07:00
Kubernetes Submit Queue 75115b081d Merge pull request #53997 from tallclair/docs-owners
Automatic merge from submit-queue (batch tested with PRs 52717, 54568, 54452, 53997, 54237). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Copy api/OWNERS to docs/api-reference

So that API changes can be approved by API approvers. Also, create api-{approvers,reviewers} aliases.

Suggested by @cblecker in https://github.com/kubernetes/kubernetes/pull/53911#issuecomment-336612394
2017-10-25 23:10:37 -07:00
Kubernetes Submit Queue b2b31ada14 Merge pull request #52717 from FengyunPan/remove-LbassV1
Automatic merge from submit-queue (batch tested with PRs 52717, 54568, 54452, 53997, 54237). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[OpenStack]Remove the LbaasV1 of OpenStack cloud provider

The Neutron LbaasV1 has been declared obsolete, LbaasV2 is a
better choice.
So let's remove the codes of LbaasV1, only support LbaasV2.
xref: #52609
Reference OpenStack doc:
https://docs.openstack.org/mitaka/networking-guide/config-lbaas.html

**Special notes for your reviewer**:
/assign @dims 
/assign @anguslees 

**Release note**:
```release-note
Remove the LbaasV1 of OpenStack cloud provider, currently only support LbaasV2.
```
2017-10-25 23:10:25 -07:00
Maru Newby fae7a7a1e3 Update vendored kube-openapi to latest 2017-10-25 21:50:02 -07:00
Kubernetes Submit Queue 8bcc1c621e Merge pull request #54143 from porridge/fix-tches-typo
Automatic merge from submit-queue (batch tested with PRs 53946, 53993, 54315, 54143, 54532). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix typo in comment.

**Release note**:
```release-note
NONE
```
2017-10-25 21:20:37 -07:00
Kubernetes Submit Queue 93e6f08772 Merge pull request #53946 from ghostcloud-cn/initializer
Automatic merge from submit-queue (batch tested with PRs 53946, 53993, 54315, 54143, 54532). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update many misspelled word initializer

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

fix misspelled word initalizer

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

**Special notes for your reviewer**:

**Release note**:

``` NONE
```
2017-10-25 21:20:25 -07:00
Kubernetes Submit Queue 17638ee018 Merge pull request #54414 from deads2k/admission-08-options
Automatic merge from submit-queue (batch tested with PRs 53760, 48996, 51267, 54414). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

update admission webhook to handle multiple auth domains

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

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

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

```release-note
generic webhook admission now takes a config file which describes how to authenticate to webhook servers
```
2017-10-25 17:37:11 -07:00
tamal 0b0300cfe6 Add go flags to go-to-protobuf 2017-10-25 17:33:54 -07:00
Vladimir Vivien 1c9aff8e58 ScaleIO - Generated files 2017-10-25 16:05:57 -04:00
Vladimir Vivien 3fb3cc7122 ScaleIO - API source code update
This commit tracks all human-generated code for API source updates.
2017-10-25 16:05:48 -04:00
Nikhita Raghunath 31c7a48e03 sample-apiserver: add docs 2017-10-26 00:54:30 +05:30
Kubernetes Submit Queue 7b588817ca Merge pull request #54399 from nikhita/staging-add-readme-license
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add README and LICENSE to staging repos

Addresses https://github.com/kubernetes/kubernetes/issues/54398.

We should use the staging files instead of having some files
authoritative in the external repo. Otherwise, we complicate the
publishing process as it has to know which files come from the latter.

`README.md` and `LICENSE` are authoritative in external repos.
We should move them to staging.

**Release note**:

```release-note
NONE
```
2017-10-25 08:57:44 -07:00
Kubernetes Submit Queue 192bb6262b Merge pull request #54287 from hzxuzhonghu/audit-stage-1
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

audit backend run before http server start and register presShutdown …

…hook



**What this PR does / why we need it**:
1. audit backend run before http server start , prevent coming request audit blocking

2.  audit backend use preShutdownHook.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-25 00:58:17 -07:00
hzxuzhonghu b96613722f audit backend run before http server start and register presShutdown hook 2017-10-25 10:33:30 +08:00
Kubernetes Submit Queue 1ba331ef59 Merge pull request #53474 from jekohk/clientgo-examples/crud-rollback
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

client-go/examples: Update CRUD Deployment sample

**What this PR does / why we need it**: 
PR motivated by [#128](https://github.com/kubernetes/client-go/issues/128), namely updating the CRUD example with the following:
- Add new step which demonstrates rolling back deployments 
- Cleanup retry loop for `Update()` steps
- Make `-kubeconfig` flag optional when running example (same as out-of-cluster example)
- Update `README.md` to reflect changes 

**Special notes for your reviewer**:
My first Kubernetes contribution- feedback very welcome!

**Release note**:

```release-note
NONE
```

/cc @ahmetb @caesarxuchao
2017-10-24 19:01:34 -07:00
Kubernetes Submit Queue 598d7e111e Merge pull request #54366 from tamalsaha/patch-1
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Bug: Fix NPE in time.Equal method
2017-10-24 16:48:14 -07:00
John Kelly e71c9f1b4b client-go: fix err scope in CRUD example
This fixes some scope isses that were introduced by shadowing vars inside anonymous functions as well as using a naked return.
Fixed by using unique err names and explicitly returning errors.
Additional improvement is using the HomeDir() util function provided by client-go instead of including a helper function at the bottom of this example.

Signed-off-by: John Kelly <jekohk@gmail.com>
2017-10-24 19:44:18 -04:00
John Kelly 94f5bcf6f7 client-go: use retry util in CRUD example
This updates the create-update-delete-deployment example with the following:
Make use of client-go retry util in Update() steps instead of simple for loops.
Using RetryOnConflict is generally better practice as it won't become stuck in a retry loop and uses exponential backoff to prevent exhausting the apiserver.
Instead of changing annotations to demonstrate Updates/Rollbacks, change the container image as it is less confusing for readers and a better real-world example.
Improve comments and README to reflect above changes.

Signed-off-by: John Kelly <jekohk@gmail.com>
2017-10-24 19:44:18 -04:00
John Kelly ce73088a71 client-go: Update CRUD example
This updates the create-update-delete-deployment example with the following:
Add rollback step to demonstrate rolling back deployments with client-go.
Modify the for-loops used in both Update steps to Get() the latest version
of the Deployment from the server before attempting Update().
This is necessary because the object returned by Create() does
not have the new resourceVersion, causing the initial Update() to always fail
due to conflicting resource versions. Putting the Get() at the top of the
loop seems to fix this bug.
Make -kubeconfig flag optional if config is in default location, using the
same method found in the out-of-cluster example.

Patch is motivated by effort to improve client-go examples.

Signed-off-by: John Kelly <jekohk@gmail.com>
2017-10-24 19:44:18 -04:00
Tamal Saha 7b69af3bd0 Fix NPE in time.Equal method 2017-10-24 09:47:25 -07:00
Kubernetes Submit Queue 16cdda003c Merge pull request #54302 from sbezverk/refactor_rbd_volume
Automatic merge from submit-queue (batch tested with PRs 54229, 54380, 54302, 54454). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Refactor RBD volume

Refactor RBD Volume Persistent Volume Spec so RBD PV's SecretRef
allows referencing a secret from a persistent volume in any namespace.
This allows locating credentials for persistent volumes in namespaces
other than the one containing the PVC.
Closes #54432
```release-note
RBD Persistent Volume Sources can now reference User's Secret in namespaces other than the namespace of the bound Persistent Volume Claim
```
2017-10-24 08:35:11 -07:00
Kubernetes Submit Queue de75c09db4 Merge pull request #47347 from deads2k/agg-34-check
Automatic merge from submit-queue (batch tested with PRs 53579, 47347). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

actually check for a live discovery endpoint before aggregating

Aggregation doesn't work without being able to hit a discovery endpoint.  This adds a simple status check for whether the discovery endpoint is reachable.  The actual status code doesn't matter, we just need to be able to make the connection.
2017-10-24 06:02:20 -07:00
Kubernetes Submit Queue f7c8a7aa17 Merge pull request #53579 from sttts/sttts-client-gen-groupname-comment-everywhere
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

generators: allow +groupName everywhere in doc.go

... not only directly above the package directive.

Avoiding confusion as in https://github.com/kubernetes/kubernetes/issues/53498.
2017-10-24 05:29:10 -07:00
Kubernetes Submit Queue e02d4a9855 Merge pull request #52897 from huzhengchuan/fix/incorrect_links_api
Automatic merge from submit-queue (batch tested with PRs 52556, 52897, 54342). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix broken links in api after moving proposals to subdirs

**What this PR does / why we need it**:
fix incorrect links in api after kubernetes/community#1010

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

**Special notes for your reviewer**:
CC @bgrant0607
**Release note**:

```
NONE
```
2017-10-23 19:34:02 -07:00
Kubernetes Submit Queue 2e998d82c4 Merge pull request #52556 from roycaihw/51790
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Apiserver proxy rewrites URL when service returns absolute path with request's host

**What this PR does / why we need it**:
When a service responses with an URL using an absolute path and the request's host (e.g. in redirection location), current transport recognizes the URL as a different host and doesn't rewrite the absolute path.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Apiserver proxy rewrites URL when service returns absolute path with request's host.
```
2017-10-23 19:24:24 -07:00
Haowei Cai 4a5b9dd70e Add comments to explain difference between req.URL.Host and req.Host. 2017-10-23 15:48:11 -07:00
Serguei Bezverkhi ab32196ffd Refactor RBD volume (Generated files) 2017-10-23 16:59:34 -04:00
Serguei Bezverkhi 1411c2698e Refactor RBD volume 2017-10-23 16:59:34 -04:00
Kubernetes Submit Queue ca8d97d673 Merge pull request #53743 from DirectXMan12/feature/polymorphic-scale-client
Automatic merge from submit-queue (batch tested with PRs 53743, 53564). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Polymorphic Scale Client

This PR introduces a polymorphic scale client based on discovery information that's able to scale scalable resources in arbitrary group-versions, as long as they present the scale subresource in their discovery information.

Currently, it supports `extensions/v1beta1.Scale` and `autoscaling/v1.Scale`, but supporting other versions of scale if/when we produce them should be fairly trivial.

It also updates the HPA to use this client, meaning the HPA will now work on any scalable resource, not just things in the `extensions/v1beta1` API group.

**Release note**:
```release-note
Introduces a polymorphic scale client, allowing HorizontalPodAutoscalers to properly function on scalable resources in any API group.
```

Unblocks #29698
Unblocks #38756
Unblocks #49504 
Fixes #38810
2017-10-23 13:39:07 -07:00
Kubernetes Submit Queue b1e2d7a9dc Merge pull request #54413 from kad/spdy-no-proxy-cidr
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use CIDR-aware proxy resolver for SPDY RoundTripper

**What this PR does / why we need it**: `kubectl attach` for example doesn't work if NO_PROXY specifies API endpoint IP via CIDR notation.

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

**Special notes for your reviewer**: Potentially it will be good to get that change to 1.8.x

**Release note**:
```release-note
- API machinery's httpstream/spdy calls now support CIDR notation for NO_PROXY
```
2017-10-23 10:07:08 -07:00
David Eads fd4ab3e061 update admission webhook to handle multiple auth domains 2017-10-23 12:33:54 -04:00
Alexander Kanevskiy cbc2688be4 Use CIDR-aware proxy resolver for SPDY RoundTripper
Fixes: #54407
2017-10-23 16:23:55 +03:00
Shyam JVS d515f0e3d2 Revert "update gRPC to pick up data race fix" 2017-10-23 13:23:48 +02:00
Nikhita Raghunath 0e46626274 Add README and LICENSE to staging repos
We should use the staging files instead of having some files
authoritative in the external repo. Otherwise, we complicate the
publishing process as it has to know which files come from the latter.

README.md and LICENSE are authoritative in external repos.
We should move them to staging.
2017-10-23 16:39:02 +05:30
FengyunPan bf7f1a0610 Update gophercloud: cleanup lbaas v1 2017-10-23 18:01:03 +08:00
Nikhita Raghunath cdcc6ac375 sample-controller: add usage instructions to README
- add usage instructions
- add Use Cases, Defining Types and Clean Up section. Copied
from apiextensions-apiserver/examples/client-go. This is done
to be consistent with all other examples.
- fix formatting
2017-10-22 15:26:38 +05:30
Henrik Schmidt 1bcfe90912 Log error when a healthz check fails 2017-10-21 14:21:16 +02:00
Kubernetes Submit Queue 507790c9c6 Merge pull request #54181 from apelisse/update-kube-openapi
Automatic merge from submit-queue (batch tested with PRs 54199, 54181, 54196). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update openapi to use kube-openapi code

**What this PR does / why we need it**: OpenAPI code has moved to `github.com/kubernetes/kube-openapi`. Let's use that code as a dependency, since now it's duplicated.

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

**Special notes for your reviewer**:

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

No user visible changes. Just code moving around.
2017-10-20 18:57:03 -07:00
Kubernetes Submit Queue 0736c55776 Merge pull request #53442 from deads2k/server-02-nesteddecoding
Automatic merge from submit-queue (batch tested with PRs 53916, 53442). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add nested encoder and decoder to admission config

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

Adds the required nested object encoder/decoder pairs for admission config extensions.

@sttts
2017-10-20 10:43:58 -07:00
Antoine Pelisse 3ed58475c4 Update openapi to use kube-openapi code 2017-10-20 09:21:06 -07:00
Kubernetes Submit Queue 4282ab39fc Merge pull request #54257 from tiran/lister-getbykey
Automatic merge from submit-queue (batch tested with PRs 53194, 54257, 53014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use GetByKey() in typeLister_NonNamespacedGet

The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954
2017-10-20 03:19:12 -07:00
Kubernetes Submit Queue 70960a5ed7 Merge pull request #53128 from dixudx/godeps_fix_grpc_data_race
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

update gRPC to pick up data race fix

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
update gRPC to v1.6.0 to pick up data race fix grpc/grpc-go#1316 
```
2017-10-20 01:32:18 -07:00
lichuqiang d3b935a4ba fix bug in OnError() of apimachinery 2017-10-20 09:22:55 +08:00
Christian Heimes 5f9d8ba5a1 Run hack/update-bazel.sh
Signed-off-by: Christian Heimes <cheimes@redhat.com>
2017-10-19 23:44:34 +02:00
Tim Allclair 83fd943cfc
restore staging api owners 2017-10-19 14:28:23 -07:00
Christian Heimes 477aadaa2f Regenerate code with hack/update-codegen.sh
Signed-off-by: Christian Heimes <cheimes@redhat.com>
2017-10-19 22:26:13 +02:00
Christian Heimes d57280efb2 Use GetByKey() in typeLister_NonNamespacedGet
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
https://github.com/openshift/origin/issues/16954

Signed-off-by: Christian Heimes <cheimes@redhat.com>
2017-10-19 22:23:58 +02:00
Kubernetes Submit Queue f07b359e5b Merge pull request #54156 from deads2k/admission-06-restclient
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

update admission webhook to accept client config

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

This plumbs a complete client through the plugin initializer for admission webhooks.  It achieves parity with our existing webhooks and provides flexibility if people want to do something special or different.  Easy things are easy, hard things are possible.  This does not change behavior for kube-apiserver.

@kubernetes/sig-auth-api-reviews @kubernetes/sig-api-machinery-bugs
2017-10-19 10:55:23 -07:00
Solly Ross f22bfcd65a [client-go] Add fake scale client
This adds a new fake scale client (for use in testing) to match the
new polymorphic scale client.
2017-10-19 13:21:03 -04:00
Solly Ross ef583aeed2 Fuzz label selectors
Previously, we did not have custom code for fuzzing label selectors.
Anything that used a label selector (like Scale) had to manually bypass
fuzzing the selector, or write its own fuzzer.  This introduces a fuzzer
for label selectors which generates random correct selectors with random
keys and values.
2017-10-19 11:01:45 -04:00
Solly Ross d61a2d9037 [client-go] Polymorphic Scale Client
This introduces a polymorphic scale client capable of operating against
scale subresources which return different group-versions of Scale.  The
scale subresources may be in group-versions different than the scale
itself, so that we no longer need a copy of every scalable resource in
the extensions API group.

To discovery which Scale group-versions go to which subresources,
discovery is used.

The scale client maintains its own internal versions and conversions to
several external versions, with a "hub" version that's a copy of the
autoscaling internal version.

It currently supports the following group-versions for Scale subresources:

- extensions/v1beta1.Scale
- autoscaling/v1.Scale
2017-10-19 11:01:45 -04:00
Solly Ross f83a19676c [client-go] fake discovery returns server groups
The fake discovery client currently returns `nil, nil` for several
methods.  Among them is the `ServerGroups` method, which is used by the
discovery REST mapper implementations.  This updates the fake discovery
client to actually return server groups so that the discovery REST
mapper can be used in tests.
2017-10-19 11:01:45 -04:00
Solly Ross eac2049fc9 [client-go] avoid Registry in fake REST client
Previously, the fake RESTClient in client-go required a Registry.  It
used the Registry to fetch the GroupVersion for the fake client.
However, the way it did so was dubious in some cases (it hard-coded the
default API group in places), and not strictly necssary.

This updates the fake client to just recieve the GroupVersion and
internal group name directly, instead of requiring a Registry, so that
it can be consumed in unit tests where a Registry isn't necessarily
readily available (e.g. elsewhere in client-go).
2017-10-19 11:01:44 -04:00
James Munnelly 49f8037dd6 Add link to k8s.io/sample-controller 2017-10-19 15:46:36 +01:00
deads2k f6fde0ba54 actually check for a live discovery endpoint before aggregating 2017-10-19 10:07:07 -04:00
David Eads 0859798e8e update admission webhook to accept client config 2017-10-19 09:52:58 -04:00
Kubernetes Submit Queue 78ada62c30 Merge pull request #53821 from rrati/apiserver-clean-shutdown
Automatic merge from submit-queue (batch tested with PRs 54145, 53821). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Added PreStopHooks to apiserver to allow clean shutdown.  

BootStrapController now registers a PreStopHook to clean up the kubernetes service endpoints.  The PreStopHooks allow the apiserver to shutdown cleanly under a controlled shutdown case.  The BootStrapController's PreStopHook will clean up after itself by removing the apiserver from the list of IPs in the kubernetes service.

fixes #53438
2017-10-19 06:50:13 -07:00
Kubernetes Submit Queue 7d190fcfcb Merge pull request #54145 from deads2k/admission-05-url
Automatic merge from submit-queue (batch tested with PRs 54145, 53821). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add url path for admission webhooks

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

Adds an optional field to admission webhook registration that allows a user to specify a path to post to.  This achieves parity with other webhooks.

Each segment is required to be a dns subdomain, which mirrors url rules for groups.

@kubernetes/api-reviewers 

```release-note
admission webhook registration now allows URL paths
```
2017-10-19 06:50:10 -07:00
David Eads 730d42011a generated 2017-10-19 08:06:38 -04:00
David Eads 33deaedaf6 add url path for admission webhooks 2017-10-19 08:06:38 -04:00
Kubernetes Submit Queue 194f3983f0 Merge pull request #54218 from CaoShuFeng/stra
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix error message of custrom resource validation

/assign @deads2k 
/assign @sttts 

**Release note**:
```
NONE
```
2017-10-19 05:02:12 -07:00
Cao Shufeng 9aed856664 fix error message of custrom resource validation 2017-10-19 17:32:25 +08:00
Kubernetes Submit Queue 9a7800f7d2 Merge pull request #52753 from munnerz/sample-controller
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

sample-controller: add example CRD controller

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

Adds a sample-controller example repository

fixes #52752

**Special notes for your reviewer**:

This is currently based on the sttts:sttts-codegen-scripts branch and should not be merged until that is (ref https://github.com/kubernetes/kubernetes/pull/52186)

**Release note**:

```
Add sample-controller repository
```

/cc @sttts @nikhita @colemickens
2017-10-19 02:32:12 -07:00
Kubernetes Submit Queue 6997d6c062 Merge pull request #54167 from deads2k/server-03-splitfiles
Automatic merge from submit-queue (batch tested with PRs 54167, 54182). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

split up large rest handling file

These are nothing but exact block moves because the giant rest.go made it really hard to find anything.

@kubernetes/sig-api-machinery-pr-reviews 

/assign sttts
/assign caesarxuchao
2017-10-18 18:21:20 -07:00
Kubernetes Submit Queue 7f26f03b68 Merge pull request #54158 from nikhita/crd-lastTransitionTime
Automatic merge from submit-queue (batch tested with PRs 49305, 54158). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiextensions: fix LastTransitionTime for NamesAccepted condition

Fixes #54148. 

Without this change, `LastTransitionTime` for the NamesAccepted condition for CRDs always showed up as `null`.

**Release note**:

```release-note
NONE
```
2017-10-18 16:35:19 -07:00
James Munnelly 740afa0e65 Add sample CustomResourceDefinition controller
sample-controller: add API types

sample-controller: regenerate files

sample-controller: add implementation

sample-controller: update bazel

sample-controller: update make-rules and cache_go_dirs

sample-controller: Set noStatus tag. Remove openapi-gen tag.

sample-controller: add deletion tombstone handling logic

sample-controller: update README, remove use of reflect in UpdateFuncs

sample-controller: add OWNERS file

sample-controller: add LICENSE
2017-10-19 00:21:57 +01:00
Kubernetes Submit Queue aaec4e20e8 Merge pull request #53164 from enisoc/rc-rs-conversion
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix RC/RS conversion

This fixes some round-trip information loss when representing an RC as an RS. I want to use these conversions in #49429 to eliminate the maintenance burden of duplicated RC code.

@kubernetes/sig-apps-pr-reviews
2017-10-18 15:42:10 -07:00
Kubernetes Submit Queue 900c0761e3 Merge pull request #53722 from deads2k/rbac-01-allow-star
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

allow */subresource in rbac policy rules

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

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

@DirectXMan12 fyi

```release-note
RBAC PolicyRules now allow resource=`*/<subresource>` to cover `any-resource/<subresource>`.   For example, `*/scale` covers `replicationcontroller/scale`.
```
2017-10-18 14:02:05 -07:00
David Eads cd663d7ad0 split up large rest handling file 2017-10-18 16:12:14 -04:00
Anthony Yeh c1377383bb
Add fuzz test for RC/RS conversion. 2017-10-18 12:37:30 -07:00
Tim Allclair 858cfc6cea
Remove redundant staging/src/k8s.io/api/core/OWNERS 2017-10-18 12:12:38 -07:00
Nikhita Raghunath 1161561ee1 Fix LastTransitionTime for NamesAccepted condition
Without this change, `LastTransitionTime` for the NamesAccepted
condition always showed up as `null`.

It makes sense to set the timestamp in `SetCRDCondition` instead of
setting it explicitly elsewhere.
2017-10-19 00:39:32 +05:30
Anthony Yeh f290819f75
Fix loss of selector during RC/RS conversion.
The `out` parameter in Convert_map_to_unversioned_LabelSelector was
being ignored.
2017-10-18 11:46:31 -07:00
David Eads 3551397658 add nested encoder and decoder to admission config 2017-10-18 14:20:48 -04:00
Tim Allclair 570c17a3b8
Create api-{approvers,reviewers} alias 2017-10-18 10:54:28 -07:00
Kubernetes Submit Queue 14a1a15485 Merge pull request #53947 from crassirostris/retry-webhook-net-errors
Automatic merge from submit-queue (batch tested with PRs 53958, 53947). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Always retry connection reset error in webhook

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

Audit logging uses webhook to send events to the backend and currently even a little blip in networking can cause several hundreds of events to be lost. This PR adds an additional check, that is similar to [the one in the rest package](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/client-go/rest/request.go#L657), but ignores the fact that the request is not GET and always retries "Connection reset by peers" error.

```release-note
Webhook always retries connection reset error.
```
2017-10-18 06:44:03 -07:00
Marcin Owsiany b9c4ea3f36 More generated files. 2017-10-18 14:17:23 +02:00
Marcin Owsiany 7f258b1179 Update generated code. 2017-10-18 11:51:27 +02:00
Marcin Owsiany 71c0c2d570 Fix typo in comment. 2017-10-18 10:39:46 +02:00
Kubernetes Submit Queue a1e786f138 Merge pull request #54059 from porridge/fix-lint-err
Automatic merge from submit-queue (batch tested with PRs 53696, 54059). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix lint warnings for useless err checks.

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

This check was recently added to golint.

**Which issue this PR fixes**

Related to #37254

**Release note**:
```release-note
NONE
```
2017-10-18 00:58:59 -07:00
Nikhita Raghunath adc34fa56e staging README: update code-generator to published
The code-generator repository has been published long back.
2017-10-17 20:54:35 +05:30
Kubernetes Submit Queue d91e97f243 Merge pull request #53037 from smarterclayton/verify_client_cert
Automatic merge from submit-queue (batch tested with PRs 53978, 54008, 53037). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Verify the bootstrap client cert before using it
2017-10-17 04:53:42 -07:00
Marcin Owsiany 49553d4a7a Fix lint warnings for useless err checks.
This check was recently added to golint.
2017-10-17 12:52:54 +02:00
Kubernetes Submit Queue 1d8f1e268f Merge pull request #47699 from supereagle/fix-typos
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix typos: remove duplicated word in comments

**What this PR does / why we need it**: Remove the duplicated word `the` in comments

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

**Special notes for your reviewer**:

```release-note
NONE
```
2017-10-17 02:35:52 -07:00
Kubernetes Submit Queue 7d59b2d338 Merge pull request #53575 from dahefanteng/master
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove repeated type conversion

**What this PR does / why we need it**:
remove repeated type conversion(convert String to Feature)
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
we just need make this conversion once.
**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-16 19:25:13 -07:00
David Eads e8a703b651 allow */subresource in rbac policy rules 2017-10-16 16:17:51 -04:00
David Eads 5a709021ab start generating rbac serialization for v1 2017-10-16 16:15:17 -04:00
Kubernetes Submit Queue 35a105af9f Merge pull request #53966 from fabiand/sampleApiserverNsManifest
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add sample-apiserver namespace manifest

**What this PR does / why we need it**:
Adds a manifest to also create the required namespace for the api server example.

It was previously proposed here kubernetes/sample-apiserver#11

```release-note
```
2017-10-16 08:27:56 -07:00
Kubernetes Submit Queue 1a80501fab Merge pull request #53862 from jianglingxia/jlx-quantity
Automatic merge from submit-queue (batch tested with PRs 53862, 53974). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

unused para useInfDec  in quantity_test

**What this PR does / why we need it**:
the para useInfDec  unused and some comment error,so fix it!
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-16 07:35:28 -07:00
Clayton Coleman 5649f9a578 Move pkg/kubelet/util/csr into client-go
Everything else it depends on was already there, and now we have a
somewhat consistent code chain.
2017-10-16 16:05:48 +02:00
Clayton Coleman b3a11aa635
Have the certificate manager decide if the server is healthy
Prevent a Kubelet from shutting down when the server isn't responding to
us but we cannot get a new certificate. This allows a cluster to coast
if the master is unresponsive or a node is partitioned and their client
cert expires.
2017-10-16 14:27:03 +02:00
Clayton Coleman cbecf17727
cache.ListWatchUntil should return err.ErrWaitTimeout
Clients shouldn't have to know about watch.ErrWatchClosed, which is
typically a server side decision to close and always means "Timeout" in
this conetxt.
2017-10-16 14:27:03 +02:00
Clayton Coleman c3bea24ab6
Collapse duplicate code into pkg/util/csr
There is no reason to duplicate this code into two places.
2017-10-16 14:27:03 +02:00
Mik Vyatskov 59bacba056 Always retry network connection error in webhook
Signed-off-by: Mik Vyatskov <vmik@google.com>
2017-10-16 12:26:14 +02:00
Fabian Deutsch 14c347f931
Add sample-apiserver namespace manifest 2017-10-16 11:57:10 +02:00
Di Xu 99e9ec120c update Godeps grpc to pick up data race fix 2017-10-16 17:55:11 +08:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Xingcai Zhang 70f47a7975 Update many misspelled word initializer 2017-10-15 22:09:26 +08:00
Robert Rati 0840e6d869 Added PreShutdownHooks to the apiserver 2017-10-15 07:27:01 -04:00
Kubernetes Submit Queue a523084d88 Merge pull request #52762 from jinzhejz/jinzhejz_typo
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix typo in quantity.go

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

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

**Release note**:
```release-note
None
```
2017-10-13 11:38:16 -07:00
Alexander Kanevskiy ad3f9a81a3 NewProxierWithNoProxyCIDR: fix handling IPv6 URLs
Current logic of splitting hostname from URL does not work if URL
is for IPv6 address and does not explicitly specify port number.
Example: "https://[2001:db8::1]/".

Use standard library function to get hostname out of URL string.
2017-10-13 20:19:22 +03:00
Kubernetes Submit Queue 8cbc9d7e27 Merge pull request #53830 from juanvallejo/jvallejo/prevent-delta-fifo-store-panic
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

perform nil check before iterating over keys

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

Fixes panic due to nil pointer dereference 

Related downstream bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1377940
cc @smarterclayton
2017-10-13 09:43:13 -07:00
Kubernetes Submit Queue f1d9962fec Merge pull request #53720 from shyamjvs/test-kubemark
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Optimize random string generator to avoid multiple locks & use bit-masking

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

We recently started seeing a 50% decrease in scheduling throughput (for e.g in kubemark-500 scale job) and turns out https://github.com/kubernetes/kubernetes/pull/53135 introduced it.
The reason is [this call](2caae38d32/plugin/pkg/scheduler/algorithm/predicates/predicates.go (L272)) to create a random 32-length string.
From the code of the `rand` utility (which is being heavily used throughout the system for randomizing object names), I noticed following performance issues:
- to create an n-length string, we are making n calls to `rand.Intn()` each of which does a lock+unlock operation on the RNG.. while just 1 lock+unlock operation is enough for all
- we're choosing one character (from an alphabet of 27 chars) per each random integer.. while we can select 10 characters using a single int63 (by masking and bit-shifting) as 1 character uses just 5 bits of randomness
- the character set is defined as a global slice (mutable), so the compiler needs to fetch length of the slice on each invocation to `len()` (we're making n of those).. while we can just use a const string (immutable) which will make len directly available as a cached constant (yes, go does it!)

This PR is making the above fixes. I'll try to add some benchmarking to measure the difference (as @wojtek-t suggested).

/cc @kubernetes/sig-scalability-misc @kubernetes/sig-scheduling-bugs @kubernetes/sig-api-machinery-misc @wojtek-t @smarterclayton
2017-10-13 06:11:09 -07:00
Kubernetes Submit Queue cc49b34d29 Merge pull request #53586 from sttts/sttts-storage-shutdown
Automatic merge from submit-queue (batch tested with PRs 53249, 53586). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiextensions-apiserver: stop cacher on CRD update

Potentially fixes #53485
2017-10-13 05:09:43 -07:00