Commit Graph

2831 Commits (f11c35eb2964229068459e0ebae76ef3203b66ea)

Author SHA1 Message Date
Eric Chiang cba8939504 certificate manager: reduce max backoff from 128s to 32s 2017-11-08 16:24:01 -08:00
Kubernetes Submit Queue 255a1be780
Merge pull request #54780 from CaoShuFeng/patch-twice
Automatic merge from submit-queue (batch tested with PRs 54493, 52501, 55172, 54780, 54819). 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>.

partial fix crd patch failing

partial fix https://github.com/kubernetes/kubernetes/issues/53379

**Release note**:
```
NONE
```
2017-11-08 15:41:21 -08:00
Dr. Stefan Schimanski c558d2a351 apiserver: add validating admission tests
- in endpoint tests
- in generic registry
- in patch handler
- in admission chain
2017-11-08 20:45:40 +01:00
Dr. Stefan Schimanski 8d98c84627 reflector: exit retry loop on closed stopCh 2017-11-08 20:42:11 +01:00
Kubernetes Submit Queue 08781adf13
Merge pull request #54979 from smarterclayton/symlink
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>.

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.

@liggitt
2017-11-07 22:35:54 -08:00
Janet Kuo b0c086eeb9 Autogen 2017-11-07 21:49:24 -08:00
Janet Kuo dc0167bd7f Add conditions to DaemonSet API 2017-11-07 21:49:24 -08:00
Kubernetes Submit Queue 84f2bf3a68
Merge pull request #54920 from tengqm/improve-cronjob-doc
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>.

Improve cronjob concurrency policy doc

**What this PR does / why we need it**:
The CronJob API documentation (https://kubernetes.io/docs/api-reference/v1.8/#cronjobspec-v1beta1-batch) did not clearly state what can be used as `concurrencyPolicy`. Instead, it only says that the default value is "Raw".

**Which issue(s) this PR fixes**:

**Special notes for your reviewer**:
This patch is not changing any code logic but it involves generated "code".

**Release note**:
```release-note
NONE
```
2017-11-07 21:34:11 -08:00
hzxuzhonghu 9d1e6d3e2c remove redundant code in admission initializer 2017-11-08 10:54:06 +08:00
Tim Allclair 0b4e8f9b3a
generated code 2017-11-07 12:38:29 -08:00
Tim Allclair 72196b9a33
Clarify DefaultAddCapabilities behavior 2017-11-07 12:38:24 -08:00
Kubernetes Submit Queue 47d1973c18
Merge pull request #55175 from sttts/sttts-lock-registry-cleanup
Automatic merge from submit-queue (batch tested with PRs 53592, 52562, 55175, 55213). 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: protect registry cleanup against concurrent access

The mechanism uses global state during testing. Better protect it and fail early when a race is happening.

Related to https://github.com/kubernetes/kubernetes/issues/54095
2017-11-07 11:21:23 -08:00
Kubernetes Submit Queue d33077526a
Merge pull request #53273 from mikedanese/authtristate
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 support for short-circuit deny in union authorizer

This change has no behavioral changes.

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

```release-note
Add support for the webhook authorizer to make a Deny decision that short-circuits the union authorizer and immediately returns Deny. 
```
2017-11-07 09:25:37 -08:00
Kubernetes Submit Queue eb578813cb
Merge pull request #55157 from sttts/sttts-etcd3-scheme
Automatic merge from submit-queue (batch tested with PRs 55061, 55157, 55231). 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: remove scheme arg from NewUnsecuredEtcd3TestClientServer

Not necessary anymore.
2017-11-07 06:03:16 -08:00
supereagle b694d51842 use versiond group clients from client-go 2017-11-07 14:47:22 +08:00
Kubernetes Submit Queue 5b7ce60fce
Merge pull request #54786 from shiywang/bump-protobuf
Automatic merge from submit-queue (batch tested with PRs 55093, 54966, 55047, 54971, 54786). 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>.

vendor update: github.com/golang/protobuf

When I'm working on PR: https://github.com/kubernetes/kubernetes/pull/54782, I met a problem here: https://github.com/golang/protobuf/issues/372, which I think we need to update our vendor of protobuf
and I ask Dr. Stefan for suggestion, here is our coversation


shiywang [5:09 PM] 
hi, Dr. Stefan i'm sorry to bother, I have a simple question, I was working on a pr which need to use protobuf custom field, and I run into this problem here: https://github.com/golang/protobuf/issues/372  which I think is due to our codebase's protobuf vendor is too old `vendor/github.com/golang/protobuf`,  do you think I can update that vendor to lastest one ?  also I noticed there's also an extend package called `vendor/github.com/gogo/protobuf/proto` what's the releationship between those two ?  which one should I update ?

sttts
[5:11 PM] 
hi

[5:11] 
don't know much about the proto internals either, @claytonc is probably the only one

[5:12] 
create a vendor/github.com/golang/protobuf bump PR and assign it to him

shiywang [5:12 PM] 
sounds good, thank you sir

so 
/assign @smarterclayton 
for suggestion, thanks

```release-note
NONE
```
2017-11-06 20:39:05 -08:00
Kubernetes Submit Queue b458838350
Merge pull request #54971 from itowlson/azure-sdk-v11.1.1
Automatic merge from submit-queue (batch tested with PRs 55093, 54966, 55047, 54971, 54786). 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>.

Upgrade Azure SDK to v11.1.1

**What this PR does / why we need it**: This fixes various Azure SDK bugs per the Azure SDK for Go changelogs:

* Fixed bug in which blob types were unmarshaled incorrectly
* Fixed various package names
* Miscellaneous unspecified storage bug fixes

This is also a prerequisite for a bug fix for running out of firewall rules when exposing large numbers of services from an Azure cluster.

**Which issue(s) this PR fixes**: None

**Special notes for your reviewer**:

1. I inadvertently committed a compatibility fix along with the dependency upgrade (which the guidelines say should have been two separate commits).  The offending file is `pkg/cloudprovider/providers/azure.go`.

2. We require an urgent bug fix for the firewall rules limit so it would be great if we could get this agreed quickly.  I have struggled with the dependency upgrade process a bit so if it looks wrong, please let me know as soon as you can!  Thanks!

**Release note**:

```release-note
Upgraded Azure SDK to v11.1.1.
```
2017-11-06 20:39:00 -08:00
Cao Shufeng 1e800350a2 partial fix crd patch failing
partial fixes https://github.com/kubernetes/kubernetes/issues/53379
2017-11-07 09:44:24 +08:00
Kubernetes Submit Queue 67c9e7419c
Merge pull request #54586 from DirectXMan12/bug/fix-incorrect-scale-and-hpa-gvks
Automatic merge from submit-queue (batch tested with PRs 53645, 54734, 54586, 55015, 54688). 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 Incorrect Scale Subresources and HPA e2e ScaleTargetRefs

The HPA e2es failed to actually set `apiVersion` on the created HPAs, which previous was ignored.  Since the polymorphic scale client was merged, this behavior is no longer tolerated (it was never correct to begin with, but it accidentally worked).

Additionally, the `apps` resources have their own version of scale.  Until `apps/v1beta1` and `apps/v1beta2` go away, we need to support those versions in the scale client.

Together, these broke some of the HPA e2es.

Fixes #54574

```release-note
NONE
```
2017-11-06 15:33:43 -08:00
Janet Kuo 948bd7bbc1 Add hook information when rejecting a request 2017-11-06 11:16:36 -08:00
Dr. Stefan Schimanski a246d6f1d1 apiserver: protect registry cleanup against concurrent access 2017-11-06 18:35:56 +01:00
Eric Chiang fa40bc8f18 audit policy: reject audit policy files without apiVersion and kind 2017-11-06 08:46:49 -08:00
Kubernetes Submit Queue 7966af637e
Merge pull request #55169 from sttts/sttts-cache-stop-race
Automatic merge from submit-queue (batch tested with PRs 55169, 54990). 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: fix Cacher.Stop() race
2017-11-06 08:27:36 -08:00
Kubernetes Submit Queue 099935df14
Merge pull request #54950 from sttts/sttts-code-gen-go-names
Automatic merge from submit-queue (batch tested with PRs 54535, 54950, 55081). 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>.

code-gen: add +groupGoName to allow unique Go identifiers in clientsets and informers

We use the first segement of the GroupName as Go name. Hence, a GroupName
"policy.k8s.io" and "policy.authorization.k8s.io" could not live in the
same clientset or shared informer factory. This PR add another tag:

```
  // +groupGoName=AuthorizationPolicy
```
2017-11-06 07:30:44 -08:00
Kubernetes Submit Queue 175af4c3c4
Merge pull request #54535 from nikhita/apiextensions-typed-client
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>.

apiextensions/examples: add typed client

It was discussed in https://github.com/kubernetes/kubernetes/pull/52753#issuecomment-337840762 to add a typed client example to apiextensions-apiserver and remove the controller part.

For an example controller, we have [`k8s.io/sample-controller`](https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/sample-controller) now.

**Release note**:

```release-note
NONE
```
2017-11-06 07:25:07 -08:00
Dr. Stefan Schimanski a30c0f477d apiserver: fix Cacher.Stop() race 2017-11-06 15:37:07 +01:00
Dr. Stefan Schimanski f4b8276001 Update generated code 2017-11-06 14:04:33 +01:00
Dr. Stefan Schimanski 11d9dd8cec apiserver: remove scheme arg from NewUnsecuredEtcd3TestClientServer 2017-11-06 13:05:33 +01:00
Dr. Stefan Schimanski 622d985ea7 code-gen: add example2 type to test +groupGoName 2017-11-06 12:16:24 +01:00
Dr. Stefan Schimanski a62e6310cb code-gen: allow overlapping prefixes in GroupNames 2017-11-06 12:16:24 +01:00
hzxuzhonghu 6bca31cb49 implement SafeWaitGroup without race issue 2017-11-06 10:34:14 +08:00
foxyriver cdc4aca9a3 stop timer 2017-11-06 10:02:38 +08:00
Nikhita Raghunath 30732bb0cc update apiextensions-apiserver godeps 2017-11-05 14:37:38 +05:30
Nikhita Raghunath 019583ad7d typed client: add generated files 2017-11-05 14:37:38 +05:30
Nikhita Raghunath 355279c866 typed client: add tags and script for code generation 2017-11-05 14:37:27 +05:30
Nikhita Raghunath 1e3918e4b1 remove dynamic client 2017-11-05 13:44:06 +05:30
Cao Shufeng acb90b6547 [trival]remove duplicated code from unit test 2017-11-05 15:02:41 +08:00
Shiyang Wang 1b3059d1ac update staging files 2017-11-04 15:22:13 +08:00
Kubernetes Submit Queue 2ecb368026
Merge pull request #53679 from kow3ns/workloadsv1
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>.

Workloads V1

**What this PR does / why we need it**: This PR promotes the Deployment, ReplicaSet, and DaemonSet StatefulSet, ControllerRevision kinds to the apps/v1 group version.

https://github.com/kubernetes/features/issues/353

**Special notes for your reviewer**:
There will be at least two followups to this PR. The first to add a scale sub-resource when the correct location is resolved, and the second to deal with Conditions in the workloads API.

While it would have been preferable to move the kinds individually providing a lesser burden on reviewers, this proved impracticable due to the intricacies of version resolution in kubectl for objects of the different kinds in the same group.  

```release-note
DaemonSet, Deployment, ReplicaSet, and StatefulSet have been promoted to GA and are available in the apps/v1 group version.
```
2017-11-03 15:17:16 -07:00
Mike Danese 90d551a0de autogenerated 2017-11-03 13:46:29 -07:00
Mike Danese 096da12fc4 add deny to SAR API 2017-11-03 13:46:29 -07:00
Mike Danese cfe580c99f modify the union authorizer to return on the first Approve or Deny and to continue on Unknown 2017-11-03 13:46:28 -07:00
Mike Danese 12125455d8 move authorizers over to new interface 2017-11-03 13:46:28 -07:00
Mike Danese ee4d2d0a94 refactor authorizer to return a tristate decision 2017-11-03 13:46:28 -07:00
Kubernetes Submit Queue 71155962aa
Merge pull request #54936 from wackxu/deletime
Automatic merge from submit-queue (batch tested with PRs 55050, 53464, 54936, 55028, 54928). 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 deletionTimestamp with information about finalizer effect

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

ref https://github.com/kubernetes/community/pull/1177

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:Fixes # https://github.com/kubernetes/website/issues/6128

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-03 12:59:16 -07:00
Kubernetes Submit Queue 1ad792f01d
Merge pull request #53464 from juanvallejo/jvallejo/output-empty-creation-ts-as-null
Automatic merge from submit-queue (batch tested with PRs 55050, 53464, 54936, 55028, 54928). 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>.

output empty creationTimestamp as null

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

Updates the value of the `creationTimestamp` field to be `null`
when empty, to keep parity between it and `deletionTimestamp`.

Adds a round-trip test to ensure that unstructured objects containing
empty metadata fields are able to be re-converted back into internal
or external objects. Prior to the proposed patch in this PR, an
unstructured object whose `.metadata.creationTimestamp` value had
been set through the metadata accessor to an empty value 
(`metav1.Time{}` in this case), was unable to be re-converted to an
internal or external type using the runtime decoder. Conversion would
fail with the error:

```
unstructured_test.go:177: FromUnstructured failed: parsing time "" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "2006"
```

cc @liggitt @fabianofranz
2017-11-03 12:59:12 -07:00
Kubernetes Submit Queue 85a6ec7b61
Merge pull request #55052 from hzxuzhonghu/admission-handler
Automatic merge from submit-queue (batch tested with PRs 51401, 54056, 54977, 55017, 55052). 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 admission handler and add UT

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

remove Redundant code, and add UT case.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE

```
2017-11-03 12:08:04 -07:00
Kubernetes Submit Queue 6f98cc9f6a
Merge pull request #55017 from nikhita/remove-tpr-extensions
Automatic merge from submit-queue (batch tested with PRs 51401, 54056, 54977, 55017, 55052). 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>.

extensions: remove TPR remnants

The extensions group still had the TPR types + generated client. Having this in the codebase doesn't create any problems but would be good to clean up, especially since TPR access has been removed in 1.8.

**Release note**:

```release-note
NONE
```

/assign @sttts @deads2k
2017-11-03 12:08:02 -07:00
Kenneth Owens 7c772ab2ad autogenerated code 2017-11-03 10:16:43 -07:00
Kubernetes Submit Queue 7ec4790991
Merge pull request #54394 from sttts/sttts-conversion-gen-kube-peer-dirs
Automatic merge from submit-queue (batch tested with PRs 51874, 54394). 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>.

conversion-gen: cut off kube dependencies in extra-peer-dirs

Fixes #54301

This makes conversion-gen usable in a context without a vendored k8s.io/kubernetes.

```release-note
In conversion-gen removed Kubernetes core API from default extra-peer-dirs.
```
2017-11-03 09:07:45 -07:00
Nikhita Raghunath e9bb42d3bc remove generated files with tpr 2017-11-03 21:16:51 +05:30
Nikhita Raghunath 6a87d99a38 generated files: remove tpr 2017-11-03 21:16:10 +05:30
Nikhita Raghunath 3b0b95ecbf Remove TPR remnants
There are still TPR types and generated client
in the extensions group. It is better to clean
that up, now that it has been removed from master.
2017-11-03 21:15:58 +05:30
hzxuzhonghu ac7ca5bd0a refactor admission handler and add UT 2017-11-03 16:47:19 +08:00
wackxu 25354c73c3 Update deletionTimestamp with information about finalizer effect 2017-11-03 10:48:48 +08:00
Solly Ross 2c9fc43294 [client-go] Add apps.Scale support to Scale client
apps/v1betaX inadventertently contains its own variant of Scale.  In
order to support scaling Deployments, ReplicaSets, etc, we need to support
these versions of Scale as well.
2017-11-02 22:20:39 -04:00
Ivan Towlson 70d496e829 Fix go-autorest dependency in client-go staging 2017-11-02 22:48:48 +00:00
Kenneth Owens 26bf978c07 Promotes the StatefulSet, ControllerRevision, Deployment, and ReplicaSet kinds to the apps/v1 group version. 2017-11-02 14:19:04 -07:00
Kubernetes Submit Queue 3a15fdbe7e
Merge pull request #54643 from mtaufen/structure-manifest-url-header
Automatic merge from submit-queue (batch tested with PRs 52367, 53363, 54989, 54872, 54643). 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>.

Lift embedded structure out of ManifestURLHeader field

Related: #53833

```release-note
It is now possible to set multiple manifest url headers via the Kubelet's --manifest-url-header flag. Multiple headers for the same key will be added in the order provided. The ManifestURLHeader field in KubeletConfiguration object (kubeletconfig/v1alpha1) is now a map[string][]string, which facilitates writing JSON and YAML files.
```
2017-11-02 12:59:24 -07:00
Kubernetes Submit Queue 55e216f56e
Merge pull request #54957 from apelisse/update-kube-openapi
Automatic merge from submit-queue (batch tested with PRs 55004, 54957). 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 kube-openapi to use validation

**What this PR does / why we need it**: Moves openapi validation code to kube-openapi, so that we can move the rest of the code to apimachinery repository, so that later we can use it from both the client and the server.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-11-02 11:17:33 -07:00
juanvallejo 2008750398
remove empty creationTimestamp field 2017-11-02 14:07:56 -04:00
Antoine Pelisse 8f7262e819 Update kube-openapi to use validation 2017-11-02 09:25:03 -07:00
Dr. Stefan Schimanski d1e0a9dbfa conversion-gen: cut off kube dependencies in extra-peer-dirs 2017-11-02 17:10:17 +01:00
Kubernetes Submit Queue 40212c17cd
Merge pull request #54484 from sttts/sttts-split-psp
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>.

admission: wire through validating-only admission

Based on https://github.com/kubernetes/kubernetes/pull/54232.

This is important and required for beta because it affects the shape of the webhook admission plugins that are going to be produced and is needed to make sure that our existing chain continues to properly verify and protect the API objects based on their final state after webhook admission mutators run.

We discussed this in the October 11 API machinery call with @erictune and @caesarxuchao and we agreed to do this as a requirement for beta. See this part of the recording: https://www.youtube.com/watch?v=mrgDPHyr4VY#t=325 .
2017-11-02 04:02:34 -07:00
Kubernetes Submit Queue 7aed663051
Merge pull request #53558 from nikhita/cr-strategic-merge-patch
Automatic merge from submit-queue (batch tested with PRs 54800, 53898, 54812, 54921, 53558). 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 for strategic merge patch of custom resources

Fixes #50037.

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.

**Release note**:

```release-note
NONE
```

/cc @sttts @deads2k @ncdc
2017-11-02 03:14:27 -07:00
Kubernetes Submit Queue b7968e0907
Merge pull request #54921 from weiwei04/fix_reflector_last_resource_version
Automatic merge from submit-queue (batch tested with PRs 54800, 53898, 54812, 54921, 53558). 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>.

rename metric reflector_xx_last_resource_version

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

mv reflector name from metric name to metric label

before:

```
reflector_k8s_io_kubernetes_pkg_client_informers_informers_generated_internalversion_factory_go:73_8664_last_resource_version{instance="104.154.20.21:443",job="kubernetes-apiservers"}
```

after

```
reflector_last_resource_version{instance="10.0.2.15:6443",job="kubernetes-apiservers",name="k8s_io_kubernetes_pkg_client_informers_informers_generated_internalversion_factory_go_73_8664"}
```

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

**Special notes for your reviewer**:

None

**Release note**:

```release-note
NONE
```
2017-11-02 03:14:24 -07:00
Kubernetes Submit Queue 6f03384f24
Merge pull request #53898 from kad/fix-ipv6-noproxy
Automatic merge from submit-queue (batch tested with PRs 54800, 53898, 54812, 54921, 53558). 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>.

NewProxierWithNoProxyCIDR: fix handling IPv6 URLs

**What this PR does / why we need it**:
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.

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

**Release note**:
```release-note
- Fix handling of IPv6 URLs in NO_PROXY.
```

/area ipv6
/sig api-machinery
2017-11-02 03:14:19 -07:00
Dr. Stefan Schimanski 35bb6823ea Update bazel 2017-11-02 09:33:41 +01:00
Dr. Stefan Schimanski aedcf681b3 admission: rename Validate{ -> Initialization}, Validat{ingAdmit -> e} 2017-11-02 09:29:55 +01:00
Dr. Stefan Schimanski 2452afffe0 admission: wire create+update validation func into kube registries 2017-11-02 09:29:16 +01:00
Kubernetes Submit Queue 66f72442c4
Merge pull request #54066 from tengqm/improve-delete-options
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>.

Improve deleteOptions doc

**What this PR does / why we need it**:
This PR improves the doc of the 'PropagationPolicy' property of the DeleteOptions struct.
The said field is a string. It is very important a field for people who invoke a delete API.
For example, direct invocation of the deployment-delete API using the python client will have the replicaset and pods left behind. However, this field was not well documented. When people wanted to try different options, they have to dig into k8s source code to find out the acceptable values.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-11-02 00:57:28 -07:00
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