Commit Graph

3990 Commits (5f4025c0291b39409ab39e3a69d9936c635610eb)

Author SHA1 Message Date
jennybuckley 5e23dd0517 Remove unnecessary typer from create/update handlers 2018-04-23 12:29:37 -07:00
David Eads 0710f72c65 remove confusing flexibility for metadata interpretation 2018-04-23 13:31:55 -04:00
fisherxu 87de76fa48 remove repeated resourceversion 2018-04-23 23:38:14 +08:00
Clayton Coleman 368959346a
When bootstrapping a client cert, store it with other client certs
The kubelet uses two different locations to store certificates on
initial bootstrap and then on subsequent rotation:

* bootstrap: certDir/kubelet-client.(crt|key)
* rotation:  certDir/kubelet-client-(DATE|current).pem

Bootstrap also creates an initial node.kubeconfig that points to the
certs. Unfortunately, with short rotation the node.kubeconfig then
becomes out of date because it points to the initial cert/key, not the
rotated cert key.

Alter the bootstrap code to store client certs exactly as if they would
be rotated (using the same cert Store code), and reference the PEM file
containing cert/key from node.kubeconfig, which is supported by kubectl
and other Go tooling. This ensures that the node.kubeconfig continues to
be valid past the first expiration.
2018-04-23 10:23:01 -04:00
hzxuzhonghu 9ce6da671d avoid calling Handles twice 2018-04-21 13:44:14 +08:00
hzxuzhonghu cd4c71422e fix typo: mutating validating admission should be distinguished 2018-04-21 11:37:36 +08:00
Kubernetes Submit Queue 9c25da64f0
Merge pull request #62649 from liggitt/loopback-routing
Automatic merge from submit-queue (batch tested with PRs 50899, 62649). 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>.

Ensure webhook service routing resolves kubernetes.default.svc correctly

Going through the normal endpoint resolve path isn't correct in multi-master scenarios

The auth wrapper is pulling from LoopbackClientConfig, the service resolver should do the same

```release-note
Fixes the kubernetes.default.svc loopback service resolution to use a loopback configuration.
```
2018-04-20 15:34:12 -07:00
Kubernetes Submit Queue 6da4355ad5
Merge pull request #62733 from soltysh/discovery_timeout
Automatic merge from submit-queue (batch tested with PRs 62876, 62733, 62827). 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>.

Set a default request timeout for discovery client

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1546117

Adds a default request timeout to requests made by the discovery client.
This prevents a command from hanging indefinitely due to one or multiple calls
to the apiserver taking longer than usual when when a --request-timeout flag value
has not been set.

/assign @deads2k @juanvallejo 

**Release note**:
```release-note
NONE
```
2018-04-20 13:39:11 -07:00
Jordan Liggitt 54c883f27b
Honor existing CA bundle and TLS server name in webhook client 2018-04-20 12:26:39 -04:00
Jordan Liggitt 6f65742474
ensure tls server name is used in transport 2018-04-20 12:26:38 -04:00
Jordan Liggitt d45fbce379
distinguish custom dialers in transport cache 2018-04-20 12:26:38 -04:00
Jordan Liggitt fe23fa3eee
Ensure service routing resolves kubernetes.default.svc correctly 2018-04-20 12:26:38 -04:00
Kubernetes Submit Queue bfae47ad87
Merge pull request #60709 from deads2k/client-02-fake-copy
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>.

deep copy fake client actions to avoid accidental mutation

I just got bit by this downstream.  Without a deep copy it is possible accidentally mutate the thing you created, thus invalidating your testing.  It's particularly nasty inside of a controller doing a loop on objects, making refs to them, and creating.  This works running in an actual process since we serialize and write, but fails unit tests since there is no serialization step.

@kubernetes/sig-api-machinery-bugs 

```release-note
NONE
```
2018-04-20 08:28:41 -07:00
Maciej Szulik 7bd48a7e23
Set a default request timeout for discovery client 2018-04-20 16:22:53 +02:00
Kubernetes Submit Queue 5dde701b87
Merge pull request #62412 from bhcleek/go1.10
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>.

generated code should pass go vet for go1.10

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

Update code generator and the code it generates to pass `go vet`.

go1.10 runs `go vet` whenever `go test` is run. Because of this, generated code for CRDs needs to pass `go vet`.

**Release note**:

```release-note
Code generated for CRDs now passes `go vet`.
```
2018-04-20 06:22:31 -07:00
Kubernetes Submit Queue a95d9f0e65
Merge pull request #62523 from wackxu/ldoc
Automatic merge from submit-queue (batch tested with PRs 59592, 62308, 62523, 62635, 62243). 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 comments for local volume

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

**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/kubernetes/issues/62278

**Special notes for your reviewer**:
/assign @jsafrane @msau42 

**Release note**:

```release-note
NONE
```
2018-04-19 14:50:21 -07:00
Kubernetes Submit Queue dffe94a0c1
Merge pull request #59592 from soltysh/roundtrip_tests
Automatic merge from submit-queue (batch tested with PRs 59592, 62308, 62523, 62635, 62243). 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>.

Roundtrip test helper for external types

**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 #54698

**Special notes for your reviewer**:
/assign @deads2k @sttts 
Since you've asked for it in the original issue. The FIXME I've pointed out to is worth addressing, but I'd prefer to do it afterwards. Do we want to implement appropriate test for all the api groups from `k8s.io/api` ?

**Release note**:
```release-note
NONE
```
2018-04-19 14:50:13 -07:00
Zhen Wang e102633ae8 Change docker/default to runtime/default 2018-04-19 10:39:53 -07:00
David Hao 48ef7645df Exclude keys containing empty patches in the final patch 2018-04-19 12:38:23 -04:00
Van Tu e1cd5eeabc Update github.com/stretchr/testify to v1.2.1
cd $GOPATH/src/k8s.io/kubernetes
hack/godep-restore.sh
rm -rf Godeps
rm -rf vendor
hack/godep-save.sh
hack/update-staging-godeps.sh
2018-04-19 10:00:31 -04:00
Matthias Bertschy 9b15af19b2 Update all script to use /usr/bin/env bash in shebang 2018-04-19 13:20:13 +02:00
Di Xu 10201f3f2a read openstack auth config from client config 2018-04-19 17:05:59 +08:00
Kubernetes Submit Queue efadf7b9e7
Merge pull request #61877 from mikedanese/depeid
Automatic merge from submit-queue (batch tested with PRs 62481, 62643, 61877, 62515). 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 deprecated ExternalID

This field has been deprecated since 1.1. After we remove it we can remove "self delete" from the node's permission set.

@kubernetes/api-reviewers 
@kubernetes/sig-auth-pr-reviews 

fixes https://github.com/kubernetes/kubernetes/issues/61966
part of https://github.com/kubernetes/community/pull/911

```release-note
Kubelets will no longer set `externalID` in their node spec.
```
2018-04-18 17:53:16 -07:00
Billie Cleek 95ad9009c3 regenerate fakes 2018-04-18 16:09:36 -07:00
Billie Cleek 44a9cc55b8 generate code that passes go vet
* Make sure sync.RWMutex values aren't copied.
2018-04-18 15:53:53 -07:00
Jordan Liggitt 8ea88a5092
Remove request context mapper 2018-04-18 17:03:31 -04:00
Andrew Lytvynov ff85d34d4e Add awly as reviewer in several subtrees 2018-04-18 12:22:04 -07:00
Antoine Pelisse 8341c48b1b apiserver: move patch tests to their own file 2018-04-18 10:56:45 -07:00
Mike Danese dbe49fc378 autogenerated 2018-04-18 10:20:23 -07:00
Mike Danese a242aeefed rename ExternaID to something that is obviously deprecated 2018-04-18 10:05:18 -07:00
Kubernetes Submit Queue 4bccf6a7aa
Merge pull request #60201 from sttts/sttts-unstructured-convert-to-version
Automatic merge from submit-queue (batch tested with PRs 60201, 62744). 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>.

apimachinery: normal conversion code path for Unstructured in ConvertToVersion

Preparation for https://github.com/kubernetes/kubernetes/pull/60113
2018-04-18 07:58:15 -07:00
Kubernetes Submit Queue fdbc9ef9a6
Merge pull request #62783 from sttts/sttts-apiserver-CONTRIBUTING.md
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 k8s.io/apiserver/CONTRIBUTING.md

Fixes https://github.com/kubernetes/apiserver/issues/37
2018-04-18 06:18:30 -07:00
Dr. Stefan Schimanski caf007b5bf Add k8s.io/apiserver/CONTRIBUTING.md 2018-04-18 14:09:10 +02:00
Kubernetes Submit Queue 96746166d9
Merge pull request #62734 from liggitt/log-malformed-webhook
Automatic merge from submit-queue (batch tested with PRs 62378, 62734). 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 webhook request error

Fixed https://github.com/kubernetes/kubernetes/issues/26606

```release-note
NONE
```
2018-04-18 04:24:13 -07:00
Kubernetes Submit Queue 42f6687a1c
Merge pull request #60536 from immutableT/transformer_metrics
Automatic merge from submit-queue (batch tested with PRs 62748, 60536, 62300, 62661, 62731). 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>.

Instrument transformer.go with latency metrics.

**What this PR does / why we need it**:
Instrument transformer.go with latency metrics - allowing to measure performance impact of adding KMS Providers.
**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"
```
2018-04-17 19:53:15 -07:00
Kubernetes Submit Queue 1112fa4484
Merge pull request #62748 from liggitt/default-gen
Automatic merge from submit-queue (batch tested with PRs 62748, 60536, 62300, 62661, 62731). 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 default generation for example packages

the example API packages were missing default generation tags, which meant that calls to the generated defaults were not satisfied in cross-build, which regenerates all files

follow-up to https://github.com/kubernetes/kubernetes/pull/62472

```release-note
NONE
```
2018-04-17 19:53:12 -07:00
Kubernetes Submit Queue 60141cdfd9
Merge pull request #59317 from CaoShuFeng/assert_Equal
Automatic merge from submit-queue (batch tested with PRs 62448, 59317, 59947, 62418, 62352). 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 assert.Equal argument order

Reference:
https://godoc.org/github.com/stretchr/testify/assert#Equal



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

**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
```
2018-04-17 16:31:17 -07:00
Jordan Liggitt 5e1872275a
generated changes 2018-04-17 16:19:21 -04:00
Jordan Liggitt f98572c698
Add default generation tags 2018-04-17 16:18:59 -04:00
Jordan Liggitt 55c66f79a6
Log webhook request error 2018-04-17 11:48:10 -04:00
Kubernetes Submit Queue 33f7d8618b
Merge pull request #62714 from CaoShuFeng/CaoShuFeng
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 CaoShuFeng as a reviewer of kube-apiserver

My contributions:
https://github.com/pulls?q=is%3Apr+author%3ACaoShuFeng+is%3Aclosed

**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**:
/assign @deads2k @sttts @liggitt 
**Release note**:

```release-note
NONE
```
2018-04-17 05:48:20 -07:00
Dr. Stefan Schimanski 145167f908 Generated files 2018-04-17 11:44:29 +02:00
Dr. Stefan Schimanski 0bb9261eb8 sample-apiserver: add v1beta1 with advanced conversion example from v1alpha1 2018-04-17 11:43:58 +02:00
Cao Shufeng 4c97fd4590 add CaoShuFeng as a reviewer of kube-apiserver 2018-04-17 14:32:05 +08:00
wackxu 2f648ede63 add generate file 2018-04-17 10:35:51 +08:00
wackxu fde414601e update comments for local volume 2018-04-17 10:35:51 +08:00
immutablet bfcb3cd91f Instrument transformer.go with latency metrics. 2018-04-16 11:33:10 -07:00
Kubernetes Submit Queue ee4d90aaa6
Merge pull request #62505 from mtaufen/show-deprecated-help
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>.

Show help for deprecated Kubelet flags

We recently deprecated a bunch of Kubelet flags, which caused them to disappear from `--help` output. This PR unhides these flags, so that the deprecation notice is clearly visible in `--help`.

Fixes: #62009

```release-note
NONE
```

/cc @eparis
2018-04-14 12:21:01 -07:00
Michael Taufen b02f116172 update godeps to use latest pflag 2018-04-13 17:08:48 -07:00
Kubernetes Submit Queue 7ba97b9200
Merge pull request #62234 from liggitt/apigroup-partial-discovery
Automatic merge from submit-queue (batch tested with PRs 61306, 60270, 62496, 62181, 62234). 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>.

Handle partial group and resource responses consistently

GetAPIGroupResources tolerates partial discovery responses to provide as much information to the caller as possible.

Before skipping a particular error response, check whether the response was accompanied by partial group or resource data.

There's an existing TODO to propagate partial errors that I plan to address in a follow-up, but that had more ripples and I wanted to correct this first.

```release-note
NONE
```
2018-04-13 15:03:16 -07:00
Kubernetes Submit Queue 3fc6832ad6
Merge pull request #62496 from jennybuckley/service-port-docs
Automatic merge from submit-queue (batch tested with PRs 61306, 60270, 62496, 62181, 62234). 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 WebhookClientConfig documentation regarding service ports

**What this PR does / why we need it**:
Dynamic admission webhooks backed by services [will always use 443](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/config/client.go#L133) no matter what ports are available. Our [current documentation](https://github.com/kubernetes/api/blob/master/admissionregistration/v1beta1/types.go#L257-L259) says that "If there is only one port open for the service, that port will be used."

This PR fixes that piece of documentation.
In the future we may wish to support specifying ports other than 443, but the documentation should be fixed first.

**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 #61510

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

/sig api-machinery
2018-04-13 15:03:10 -07:00
Kubernetes Submit Queue a0a742c38b
Merge pull request #61210 from hzxuzhonghu/etcd-random-check
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>.

check etcd servers by a random order

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

Every time a health check is called on the APIServer via the /healthz endpoint, an etcd healthcheck is performed. Here makes servers check with a random order.

**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 #61180

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-04-13 12:12:47 -07:00
Kubernetes Submit Queue 92065407b7
Merge pull request #62462 from jsafrane/private-mount-propagation
Automatic merge from submit-queue (batch tested with PRs 60476, 62462, 61391, 62535, 62394). 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>.

Private mount propagation

This PR changes the default mount propagation from "rslave" (newly added in 1.10) to "private" (default in 1.9 and before). "rslave" as default causes regressions, see below.

Value `"None"` has to be added to `MountPropagationMode` enum in API ("I don't want any propagation at all"), which translates to "private" on Linux. [We did not have use cases for it](https://github.com/kubernetes/community/pull/659#discussion_r131454319), but we have them now.

**Which issue(s) this PR fixes**
Fixes #62397, fixes #62396

**Special notes for your reviewer**:
CRI already has an option for private mount propagation in volumes, however it's called "PRIVATE", while Kubernetes API value is "None". I did not change PRIVATE to NONE to keep the interface stable. See `kubelet_pods.go`.

**Release note**:
```release-note
Default mount propagation has changed from "HostToContainer" ("rslave" in Linux terminology) to "None" ("private") to match the behavior in 1.9 and earlier releases. "HostToContainer" as a default caused regressions in some pods.
```


/sig storage
/sig node
2018-04-13 11:20:13 -07:00
jennybuckley 6994a36c4d Run hack/update-all.sh 2018-04-13 10:19:58 -07:00
jennybuckley 2cecd7d112 Update webhook client config docs regarding service ports 2018-04-13 10:08:30 -07:00
Kubernetes Submit Queue 9139d01c8f
Merge pull request #62374 from hzxuzhonghu/kubeapiserver-owners
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 myself to kube-apiserver/apiserver reviewers

**Release note**:

```release-note
NONE
```
2018-04-13 07:50:07 -07:00
Kubernetes Submit Queue 1b4c4898cb
Merge pull request #61459 from hzxuzhonghu/etcdv3-dial-timeout
Automatic merge from submit-queue (batch tested with PRs 62324, 61459, 62475, 62476, 61914). 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>.

etcdv3 client: add dial timeout

dial timeout is necessary for a reliable system, this pr add it for establishing an etcd connection.

**Release note**:

```release-note
NONE
```
2018-04-12 13:18:08 -07:00
Kubernetes Submit Queue 9816b43188
Merge pull request #61198 from jpbetz/etcd-3.2-upgrade-reattempt
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 default etcd server to 3.2 for kubernetes 1.11

Repply #59836 but with latest etcd 3.2 patch version (3.2.18 which includes mvcc fix and leader election timeout fix) and default `--snapshot-count` to 10k to resolve performance regression in previous etcd 3.2 server upgrade attempt (https://github.com/kubernetes/kubernetes/issues/60589#issuecomment-372458578).

See https://github.com/kubernetes/kubernetes/issues/60589#issuecomment-372458578 for details on the root cause of the performance regression and scalability test results of setting `--snapshot-count` to 10k.

```release-note
Upgrade the default etcd server version to 3.2.18
```
@gyuho @shyamjvs @jdumars @timothysc
2018-04-12 10:46:42 -07:00
Kubernetes Submit Queue 0b5fa0b94a
Merge pull request #62273 from atlassian/dont-log-when-error-returned
Automatic merge from submit-queue (batch tested with PRs 62273, 62461). 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>.

Don't log when error returned

**What this PR does / why we need it**:
Both logging and returning an error is an antipattern. If the caller wants it logged they will log it. And in this case it will be logged twice which is very confusing for debugging.

**Release note**:
```release-note
NONE
```
/kind cleanup
/sig api-machinery
2018-04-12 06:38:12 -07:00
Jan Safranek 01a44d22cf Add private mount propagation to API.
And make it default
2018-04-12 13:57:54 +02:00
Kubernetes Submit Queue 2b854df50f
Merge pull request #40933 from aveshagarwal/master-rhbz-1414813
Automatic merge from submit-queue (batch tested with PRs 40933, 62188). 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 to avoid REST API calls at log level 2.

By default, logging REST API calls at log level 2 is too verbose (see below), if log level 2 happens to be default. So increasing its default to 3.

```
I0203 12:37:27.059555   11483 wrap.go:75] PUT /api/v1/namespaces/kube-system/endpoints/kube-scheduler: (1.358954ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35168]
I0203 12:37:27.780029   11483 wrap.go:75] GET /api/v1/nodes/127.0.0.1?resourceVersion=0: (819.444µs) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format] [::1]:35154]
I0203 12:37:27.844846   11483 wrap.go:75] POST /api/v1/namespaces/default/events: (11.337447ms) 201 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format] [::1]:35154]
I0203 12:37:27.844851   11483 wrap.go:75] PATCH /api/v1/nodes/127.0.0.1/status: (9.998981ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format] [::1]:35154]
I0203 12:37:28.942863   11483 wrap.go:75] GET /api/v1/namespaces/kube-system/endpoints/kube-controller-manager: (923.711µs) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35156]
I0203 12:37:28.944556   11483 wrap.go:75] PUT /api/v1/namespaces/kube-system/endpoints/kube-controller-manager: (1.188942ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35156]
I0203 12:37:29.061483   11483 wrap.go:75] GET /api/v1/namespaces/kube-system/endpoints/kube-scheduler: (937.549µs) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35168]
I0203 12:37:29.063068   11483 wrap.go:75] PUT /api/v1/namespaces/kube-system/endpoints/kube-scheduler: (1.111312ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35168]
I0203 12:37:30.947922   11483 wrap.go:75] GET /api/v1/namespaces/kube-system/endpoints/kube-controller-manager: (935.198µs) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35156]
I0203 12:37:30.950150   11483 wrap.go:75] PUT /api/v1/namespaces/kube-system/endpoints/kube-controller-manager: (1.703438ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35156]
I0203 12:37:31.064883   11483 wrap.go:75] GET /api/v1/namespaces/kube-system/endpoints/kube-scheduler: (1.127992ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35168]
I0203 12:37:31.066503   11483 wrap.go:75] PUT /api/v1/namespaces/kube-system/endpoints/kube-scheduler: (1.098029ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35168]
I0203 12:37:32.951691   11483 wrap.go:75] GET /api/v1/namespaces/kube-system/endpoints/kube-controller-manager: (945.295µs) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35156]
I0203 12:37:32.953580   11483 wrap.go:75] PUT /api/v1/namespaces/kube-system/endpoints/kube-controller-manager: (1.331822ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35156]
I0203 12:37:33.068221   11483 wrap.go:75] GET /api/v1/namespaces/kube-system/endpoints/kube-scheduler: (912.121µs) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35168]
I0203 12:37:33.069787   11483 wrap.go:75] PUT /api/v1/namespaces/kube-system/endpoints/kube-scheduler: (1.120666ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35168]
I0203 12:37:34.955546   11483 wrap.go:75] GET /api/v1/namespaces/kube-system/endpoints/kube-controller-manager: (1.02279ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35156]
I0203 12:37:34.957812   11483 wrap.go:75] PUT /api/v1/namespaces/kube-system/endpoints/kube-controller-manager: (1.661017ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35156]
I0203 12:37:35.071528   11483 wrap.go:75] GET /api/v1/namespaces/kube-system/endpoints/kube-scheduler: (935.155µs) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35168]
I0203 12:37:35.073087   11483 wrap.go:75] PUT /api/v1/namespaces/kube-system/endpoints/kube-scheduler: (1.027371ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35168]
I0203 12:37:35.580075   11483 wrap.go:75] GET /apis/extensions/v1beta1/thirdpartyresources: (943.453µs) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format] [::1]:35144]
I0203 12:37:36.611659   11483 wrap.go:75] GET /api/v1/namespaces/default: (753.781µs) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format] [::1]:35144]
I0203 12:37:36.612516   11483 wrap.go:75] GET /api/v1/namespaces/default/services/kubernetes: (495.105µs) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format] [::1]:35144]
I0203 12:37:36.613167   11483 wrap.go:75] GET /api/v1/namespaces/default/endpoints/kubernetes: (379.568µs) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format] [::1]:35144]
I0203 12:37:36.960131   11483 wrap.go:75] GET /api/v1/namespaces/kube-system/endpoints/kube-controller-manager: (1.431137ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35156]
I0203 12:37:36.963470   11483 wrap.go:75] PUT /api/v1/namespaces/kube-system/endpoints/kube-controller-manager: (2.190438ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35156]
I0203 12:37:37.028185   11483 wrap.go:75] GET /api/v1/nodes: (1.34149ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/pod-garbage-collector] [::1]:35156]
I0203 12:37:37.074666   11483 wrap.go:75] GET /api/v1/namespaces/kube-system/endpoints/kube-scheduler: (928.261µs) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35168]
I0203 12:37:37.076314   11483 wrap.go:75] PUT /api/v1/namespaces/kube-system/endpoints/kube-scheduler: (1.240852ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35168]
I0203 12:37:37.847163   11483 wrap.go:75] GET /api/v1/nodes/127.0.0.1?resourceVersion=0: (725.021µs) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format] [::1]:35154]
I0203 12:37:37.901326   11483 wrap.go:75] PATCH /api/v1/nodes/127.0.0.1/status: (2.377445ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format] [::1]:35154]
I0203 12:37:38.968028   11483 wrap.go:75] GET /api/v1/namespaces/kube-system/endpoints/kube-controller-manager: (3.777083ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35156]
I0203 12:37:38.970313   11483 wrap.go:75] PUT /api/v1/namespaces/kube-system/endpoints/kube-controller-manager: (1.655815ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35156]
I0203 12:37:39.077913   11483 wrap.go:75] GET /api/v1/namespaces/kube-system/endpoints/kube-scheduler: (919.65µs) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35168]
I0203 12:37:39.079617   11483 wrap.go:75] PUT /api/v1/namespaces/kube-system/endpoints/kube-scheduler: (1.196855ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35168]
I0203 12:37:40.972171   11483 wrap.go:75] GET /api/v1/namespaces/kube-system/endpoints/kube-controller-manager: (936.07µs) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35156]
I0203 12:37:40.973886   11483 wrap.go:75] PUT /api/v1/namespaces/kube-system/endpoints/kube-controller-manager: (1.200048ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35156]
I0203 12:37:41.084158   11483 wrap.go:75] GET /api/v1/namespaces/kube-system/endpoints/kube-scheduler: (3.842758ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [::1]:35168]
I0203 12:37:41.085722   11483 wrap.go:75] PUT /api/v1/namespaces/kube-system/endpoints/kube-scheduler: (1.101371ms) 200 [[hyperkube/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election] [
```

xref: https://bugzilla.redhat.com/show_bug.cgi?id=1414813

@kubernetes/rh-cluster-infra 

Fix https://github.com/kubernetes/kubernetes/issues/47916
2018-04-11 21:35:01 -07:00
Joe Betz a795cb61bc Bump etcd default server version to 3.2.18 2018-04-11 21:12:44 -07:00
Kubernetes Submit Queue 3776521b1b
Merge pull request #62383 from CaoShuFeng/CustomResourceDefinition
Automatic merge from submit-queue (batch tested with PRs 62425, 62212, 60824, 62383, 62384). 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 custom resource definition validation

/assign @sttts 

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

**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
```
2018-04-11 16:36:22 -07:00
Kubernetes Submit Queue 14fca16a39
Merge pull request #60824 from hzxuzhonghu/requestContextMap-rwlock
Automatic merge from submit-queue (batch tested with PRs 62425, 62212, 60824, 62383, 62384). 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 requestcontext: use RWMutex to improve r/w performance

RequestContextMapper is one of the mostly used interface by every request, and the underlying struct is a map with Mutex protect. So here we should use RWMutex.

**Release note**:

```release-note
NONE
```
2018-04-11 16:36:19 -07:00
Billie Cleek f61630ea27 add keys to unkeyed literals 2018-04-11 10:04:48 -07:00
Kubernetes Submit Queue 99e77a76be
Merge pull request #58752 from puja108/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>.

Updated Readme for Azure (OIDC) auth provider

**What this PR does / why we need it**:
When trying this documentation in the field, I ran into some issues based on details missing here. I got it working in the end with some help from @stuartleeks from Microsoft, this PR is to help others trying to set this up not have the same question marks I had.

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

**Special notes for your reviewer**:
Includes:
* Added details and clarifications based on my experience
* Some minor copy editing

Not sure if this requires release notes, I consider it a very small change.

**Release note**:

```release-note
NONE
```
2018-04-11 05:23:36 -07:00
Cao Shufeng 30d1d129d7 fix custom resource definition validation 2018-04-11 19:33:16 +08:00
Kubernetes Submit Queue d1b38b21ef
Merge pull request #62136 from rithujohn191/oidc-hd-claim
Automatic merge from submit-queue (batch tested with PRs 61241, 62136). 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>.

OIDC required claims

**What this PR does / why we need it**: 
Currently there is no mechanism for a user to specify claims in the OIDC authentication process that are required to be present in the ID Token with an expected value. This PR adds the required claims support for the OIDC authentication. It allows users to pass in a `--oidc-required-claims` flag, and key=value pairs in the API config, which will ensure that the specified `required claims` are checked against the ID Token claims.

**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 #61276

**Special notes for your reviewer**:
Ran the following commands to update godep files:

```
./hack/godep-restore.sh -v
./hack/godep-save.sh
./hack/update-staging-godeps.sh
./hack/update-bazel.sh
```
Since we don't officially support go 1.10, kept go version to 1.9

**Release note**:

```release-note
kube-apiserver: oidc authentication now supports requiring specific claims with `--oidc-required-claim=<claim>=<value>`
```
/sig auth
/kind feature
/assign @ericchiang
2018-04-11 03:25:11 -07:00
Puja 2709a7ee0d Updated Readme for Azure (OIDC) auth provider
Includes:
* Added details and clarifications based on my experience
* Some minor copy editing

added note about resulting username

fixing last list item

clarficiation of resulting username

mainly just refering to OIDC docs

fixed comment about callback URL
2018-04-11 12:02:28 +02:00
hzxuzhonghu bcb4169a59 add myself to apiserver owners 2018-04-11 16:25:26 +08:00
Kubernetes Submit Queue f3cad465d5
Merge pull request #62333 from sttts/sttts-crd-validation-string-maps
Automatic merge from submit-queue (batch tested with PRs 59027, 62333, 57661, 62086, 61584). 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>.

CustomResources: in OpenAPI spec allow additionalProperties without properties

This implements @ayushpateria's idea https://github.com/kubernetes/kubernetes/issues/59485#issuecomment-375726922.

With this PR it becomes possible to specify `map[string]Interface{}` non-object types, e.g. `map[string]string` for selectors. On the other hands, "normal" objects use `properties`, mutually exclusively to `additionalProperties`. This way we avoid a conflict with Kubernetes API conventions that unknown objects fields are dropped.

Fixes #59485

```release-note
Allow additionalProperties in CRD OpenAPI v3 specification for validation, mutually exclusive to properties.
```
2018-04-10 22:53:16 -07:00
Kubernetes Submit Queue da85a280be
Merge pull request #62097 from hzxuzhonghu/fix-change-log
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 1.10 change log typo

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

Thanks to @christianhuening, find typo about `enable-admission-plugins` and `disable-admission-plugins`
They are plural.

**Release note**:

```release-note
NONE
```
2018-04-10 15:46:20 -07:00
Kubernetes Submit Queue c7349d8c08
Merge pull request #62287 from skriss/add-unstructured-exists-helpers
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>.

export unstructured helper function nestedFieldNoCopy

Signed-off-by: Steve Kriss <steve@heptio.com>



**What this PR does / why we need it**: Export the unstructured helper function `nestedFieldNoCopy`.  This enables checking for existence of nested fields without requiring a deep-copy via JSON. 

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-04-10 14:52:31 -07:00
rithu john dd433b595f oidc authentication: Required claims support 2018-04-10 12:02:54 -07:00
Steve Kriss d2e28006e3 export unstructured helper function nestedFieldNoCopy and add unit tests
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-04-10 10:41:52 -07:00
Mik Vyatskov 52fae99130 Implemented truncating audit backend
Signed-off-by: Mik Vyatskov <vmik@google.com>
2018-04-10 19:16:18 +02:00
Kubernetes Submit Queue f0de9af79b
Merge pull request #62074 from liggitt/scale-mapper
Automatic merge from submit-queue (batch tested with PRs 60197, 61614, 62074, 62071, 62301). 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>.

Narrow interface consumed by scale client

The scale client only uses a single method of the rest mapper, and only for preferred resource version (no resource/kind lookup or translation)

Narrow the specified interface to make it clear what function is actually required.

```release-note
NONE
```
2018-04-10 08:56:24 -07:00
Dr. Stefan Schimanski b9df44e347 CustomResources: in OpenAPI spec allow additionalProperties without properties
This allows to specify map[string]Interface{} non-object types, e.g. map[string]string
for selectors.
2018-04-10 14:12:24 +02:00
Wang Guoliang 89669283fe should use time.Since instead of time.Now().Sub 2018-04-10 12:05:51 +08:00
Kubernetes Submit Queue 7931930ff7
Merge pull request #61809 from hzxuzhonghu/corev1-api-delete
Automatic merge from submit-queue (batch tested with PRs 60692, 61809). 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 ObjectMeta and *Options from core api

remove ObjectMeta and *Options from core api

Fixes #61807

**Special notes for your reviewer**:

**Release note**:

```release-note
Remove `ObjectMeta ` `ListOptions` `DeleteOptions` from core api group.  Please use that in meta/v1
```
2018-04-09 12:19:05 -07:00
Kubernetes Submit Queue d4ded15f8a
Merge pull request #61933 from hanxiaoshuai/cleanup0330
Automatic merge from submit-queue (batch tested with PRs 59035, 61933). 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 TestGeneration in customresource/etcd_test.go

**What this PR does / why we need it**:
add TestGeneration in customresource/etcd_test.go
**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
```
2018-04-09 06:56:09 -07:00
hzxuzhonghu 599a44a92d remove deprecated ObjectMeta ListOptions DeleteOptions 2018-04-09 21:19:20 +08:00
Mikhail Mazurskiy c3e57fceb3
Re-generate clientsets 2018-04-09 19:12:47 +10:00
Mikhail Mazurskiy 7c2cf5f548
Let the caller handle the error
Both logging and returning an error is an antipattern
2018-04-09 19:12:14 +10:00
Kubernetes Submit Queue 3836e10a20
Merge pull request #62199 from liggitt/priority-partial-discovery
Automatic merge from submit-queue (batch tested with PRs 62231, 44495, 62199). 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 priority rest mapper handle partial discovery results

If the delegate restmapper returns partial results, let the priority restmapper find a prioritized entry and propagate the original error

```release-note
NONE
```
2018-04-06 20:32:06 -07:00
Jordan Liggitt e203c4e42b
Handle partial group and resource responses consistently 2018-04-06 22:42:34 -04:00
Kubernetes Submit Queue 58c0748b4d
Merge pull request #58807 from CaoShuFeng/audit_annotation_rbac
Automatic merge from submit-queue (batch tested with PRs 61183, 58807). 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 RBAC information to audit logs

Depends on: https://github.com/kubernetes/kubernetes/pull/58806
**Release note**:
```release-note
RBAC information is included in audit logs via audit.Event annotations:
authorization.k8s.io/decision = {allow, forbid}
authorization.k8s.io/reason = human-readable reason for the decision
```
2018-04-06 19:31:04 -07:00
Kubernetes Submit Queue 8d28c5102b
Merge pull request #61048 from sttts/sttts-cancel-context
Automatic merge from submit-queue (batch tested with PRs 61400, 61048). 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: cancel context on timeout in WithTimeoutForNonLongRunningRequests

Requests that block time out after 60sec, but keep the handler body running. This can lead to exhaustion of clients or other leaks. This PR adds a cancel func to the context of the request and calls it on timeout.

Note: we still do our own timeout handling as we don't trust the context to really cancel every blocking call we do.

This might explain why we see so many handler backtraces like https://gist.github.com/sttts/0ce972dc8a7911e4ca9eea7bf1ded5fa when an etcd node goes down with a hard poweroff. But it does not explain why we see oc to block for 15 minutes.
2018-04-06 14:47:08 -07:00
Kubernetes Submit Queue 7daaa826d2
Merge pull request #61400 from natronq/master
Automatic merge from submit-queue (batch tested with PRs 61400, 61048). 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: allow specifying custom resync periods for certain informer types

**What this PR does / why we need it**:
This PR extends the informer code-generator to allow the consumer to specify a custom resync period for certain informer types and uses the default resync period if none is defined.

**Special notes for your reviewer**:
Example:
```go
cs := clientset.NewForConfigOrDie(config)
resyncConfig := externalversions.ResyncConfiguration{
  &samplev1alpha1.Sample{}: 30 * time.Second,
}
informer := externalversions.NewSharedInformerFactory(cs, 2*time.Minute, externalversions.WithCustomResyncConfig(resyncConfig))
```
**Release note**:

```release-note
NONE
```
2018-04-06 14:47:05 -07:00
Jordan Liggitt e3e1729cc5
Make priority rest mapper handle partial discovery results 2018-04-06 11:24:58 -04:00
AdamDang 50139d3a26
Correct the returned message
non-nill->non-nil
2018-04-06 21:01:21 +08:00
Dr. Stefan Schimanski f3ba7f9558 apiserver: cancel context on timeout in WithTimeoutForNonLongRunningRequests 2018-04-06 11:21:17 +02:00
Dr. Stefan Schimanski 0fc2c48444 kubectl: add JSON fallback codec to cope with more strict stock versioning codec 2018-04-06 11:08:09 +02:00
Dr. Stefan Schimanski ca9d1f728b apimachinery duct tape: handle empty unstructured GV in versioning codec gracefully 2018-04-06 11:08:09 +02:00
Dr. Stefan Schimanski 556f8ccbdd apimachinery duct tape: in versioning codec avoid conversion roundtrip for same GVK 2018-04-06 11:08:09 +02:00
Dr. Stefan Schimanski 916622105d apimachinery: normal conversion code path for Unstructured in ConvertToVersion 2018-04-06 11:08:09 +02:00
hzxuzhonghu 4eb48436eb Update generated files 2018-04-06 10:17:04 +02:00
Dr. Stefan Schimanski 10969e1b8d admission/webhook: fix panic from empty response in mutating webhooks 2018-04-06 10:16:41 +02:00
Dr. Stefan Schimanski 72f8a369d0 admission/webhook: refactor to webhook = generic-webhook + source + dispatcher
- unify test cases
- remove broken VersionedAttributes override abstraction

  This overriding had no effect. The versioned.Attributes were never
  used as admission.Attributes.Better make the versioned objects
  explicit than hiding them under a wrong abstraction.
- remove wrapping of scheme.Convert
- internalize conversion package
2018-04-06 10:16:41 +02:00
Kubernetes Submit Queue 7bde13f191
Merge pull request #60021 from nikhita/sample-controller-subresources
Automatic merge from submit-queue (batch tested with PRs 60102, 59970, 60021, 62011, 62080). 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 status subresource support

Builds on top of https://github.com/kubernetes/kubernetes/pull/55168.

**DO NOT MERGE** until https://github.com/kubernetes/kubernetes/pull/55168 is merged. Adding a hold.
/hold

Update: It is now merged! 🎉 

This PR:

- Adds an example to show how to use the `/status` subresource with custom resources.
- Generates `UpdateStatus` for the `Foo` resource.
- Updates the comment in the controller to mention that `UpdateStatus` can now be used. Note: this is not enabled by default because subresources require the feature gate to be enabled and are not on by default.
- Updates the README to add feature gate information and examples for `CustomResourceSubresources`.
- Updates the README to remove feature gate information for CRD validation since the current example uses `apps/v1` deployments (and thus requires v1.9 anyway).

**Release note**:

```release-note
NONE
```

/assign sttts munnerz
2018-04-05 18:47:05 -07:00
Kubernetes Submit Queue 6dfcaabe84
Merge pull request #59970 from anubhakushwaha/Update_deployment_example
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>.

Updated the "create-update-delete-deployment" example to use apps/v1 and removed rollback example

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

*Waiting for migration to apps/v1*
> The current example at [create-update-delete-deployment/main.go](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/client-go/examples/create-update-delete-deployment/main.go) was using `RollbackTo` of `v1beta1.DeploymentSpec` which is deprecated.

The current implementation upgrades `create-update-delete-deployment` main.go to use **apps/v1** instead of **extensions/v1beta1** and removed rollback example for now. 

**Which issue(s) this PR fixes**
Helps kubernetes/client-go#346

**Special notes for your reviewer**:
Since it's my first PR dealing with codebase and not a typo fix :xD please let me know my mistakes.
I would love to resolve them.

@nikhita @sttts @jekohk Please review. The other PR #59663  got closed accidentally while changing branch.
2018-04-05 18:45:27 -07:00
Kubernetes Submit Queue 2dee2105d6
Merge pull request #62063 from atlassian/no-mutation-unstructuredcontent
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>.

Make UnstructuredContent return contents without mutating the source

**What this PR does / why we need it**:
This PR solves the issues described in #56316

Before this change:

- A call to `UnstructuredContent()` potentially modified `Object`
- The values returned by `UnstructuredContent()` could be manipulated to modify the value in `Object`. Going through the history it looks like this behavior was added before the addition of `SetUnstructuredContent()`. IMO it makes more sense now to use `SetUnstructuredContent()` or make changes to the exposed `Object` property
- `UnstructuredList` did not implement the behavior described in the godoc. The godoc stated that the value returned should be mutable, but if u.Object == nil the map returned had no effect on Object

With this PR I'm proposing `UnstructuredContent()` returns the data without providing the contract of a mutable map. It also ensures all implementations of the `Unstructured` interface abide by the doc

**Which issue(s) this PR fixes**:
Fixes #56316

**Special notes for your reviewer**:
This PR continues work started in #57713.

**Release note**:
```release-note
NONE
```
/kind bug
/sig api-machinery
/cc sttts deads2k
2018-04-05 17:03:57 -07:00
natronq a923acd042
Run hack/update-codegen.sh 2018-04-05 23:35:14 +02:00
natronq 4f4798a445
code-gen: allow specifying custom resync periods for certain informer types and switch to functional option pattern for SharedInformerFactory 2018-04-05 23:35:14 +02:00
Kubernetes Submit Queue 6a8ebdca90
Merge pull request #61905 from mengqiy/mergePatchesInSMP
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 a func to merge multiple Strategic Merge Patches into one patch

This PR is adding a function similar to 9fa11df836/merge.go (L95-L100)
It merges multiple SMPs and yield another SMP.

This PR has no risk to existing SMP code.

```release-note
NONE
```
/cc @apelisse
/assign @pwittrock
2018-04-05 13:30:03 -07:00
Dr. Stefan Schimanski 9f906618f0 apiserver: enforce shared RequestContextMapper in delegation chain 2018-04-05 14:41:56 +02:00
Mikhail Mazurskiy 1fcd199cf7
Put nil back into switch 2018-04-05 20:40:20 +10:00
Kubernetes Submit Queue 485d215582
Merge pull request #62103 from hanxiaoshuai/cleanup0404
Automatic merge from submit-queue (batch tested with PRs 61705, 61609, 62103, 62113, 62115). 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 unused function getEncodedPod in etcd_helper_test.go

**What this PR does / why we need it**:
remove unused function getEncodedPod in etcd_helper_test.go
**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
```
2018-04-04 10:27:15 -07:00
Mengqi Yu 48b6786632 support merging multiple SMP into one patch 2018-04-04 10:22:48 -07:00
Kubernetes Submit Queue f5f3d0d3d9
Merge pull request #61349 from sttts/sttts-aggregator-authz
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: add warning about not trusting authz of aggregator

The aggregator does authorization for proxied resources. But aggregated apiservers should not depend on it, but do delegated authorization in addition.

```release-note
Add warnings that authors of aggregated API servers must not rely on authorization being done by the kube-apiserver.
```
2018-04-04 05:57:08 -07:00
Mikhail Mazurskiy 53e8fd04ec
Support typed nils; test empty Unstructured is not mutated 2018-04-04 22:27:21 +10:00
Mikhail Mazurskiy d5fdac399c
Remove check for items 2018-04-04 20:54:53 +10:00
Mikhail Mazurskiy e82e8b4e89
Make UnstructuredContent return contents without mutating the source 2018-04-04 20:40:53 +10:00
hangaoshuai b07071f84b remove unused function getEncodedPod in etcd_helper_test.go 2018-04-04 18:24:48 +08:00
Kubernetes Submit Queue 22440e1576
Merge pull request #62037 from cblecker/godep-bump
Automatic merge from submit-queue (batch tested with PRs 61959, 62037). 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>.

Bump godep version to v80

**What this PR does / why we need it**:
Update the minimum godep, to v80 (supposed to be the final version).

**Release note**:
```release-note
NONE
```
2018-04-04 02:45:08 -07:00
hzxuzhonghu 549fb0cad3 fix typo 2018-04-04 16:03:17 +08:00
hzxuzhonghu e5449d32f9 run update bazel 2018-04-04 11:40:09 +08:00
hzxuzhonghu 3f73ccfcde add test case for request context mapper 2018-04-04 11:40:07 +08:00
hzxuzhonghu 564d53f71b optimize requestcontext: use RWMutex and atomic.Value 2018-04-04 11:40:01 +08:00
Kubernetes Submit Queue 5c59de28b5
Merge pull request #62085 from seans3/atomic-fix
Automatic merge from submit-queue (batch tested with PRs 62049, 62085). 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>.

Fixes incorrect atomic usage

Fixes incorrect assignment for atomic increment.
NOTE: This will be a vet error in go version 1.10.
ERROR: "direct assignment to atomic value".
No other erroneous atomic assignments found.

```release-note
NONE
```
2018-04-03 20:25:04 -07:00
Sean Sullivan 4e877f5585 Fixes incorrect atomic usage 2018-04-03 17:20:46 -07:00
Jordan Liggitt d8b69a0a65
Narrow interface consumed by scale client 2018-04-03 14:34:04 -04:00
rithu john 1f25319077 oidc authentication: email_verified claim is not required for JWT validation 2018-04-03 11:22:17 -07:00
Kubernetes Submit Queue a5133305a9
Merge pull request #61800 from rithujohn191/remove-gopass
Automatic merge from submit-queue (batch tested with PRs 61818, 61800). 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>.

Replace gopass.GetPasswdMasked() by terminal.ReadPassword()

**What this PR does / why we need it**:
Replace `gopass.GetPasswdMasked()` used for reading passwords from the terminal with [`terminal.ReadPassword()`](https://godoc.org/golang.org/x/crypto/ssh/terminal#ReadPassword). This removes the `gopass` import.

**Special notes for your reviewer**:
Ran the following commands to update `godep` files:
```
./hack/godep-restore.sh -v
./hack/godep-save.sh
./hack/update-staging-godeps.sh
./hack/update-bazel.sh
```

/sig auth
/kind enhancement
/assign @ericchiang

```release-note
NONE
```
2018-04-03 03:28:03 -07:00
Kubernetes Submit Queue 043204b1e5
Merge pull request #61498 from mindprince/delete-in-tree-gpu
Automatic merge from submit-queue (batch tested with PRs 61498, 62030). 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>.

Delete in-tree support for NVIDIA GPUs.

This removes the alpha Accelerators feature gate which was deprecated in 1.10 (#57384).
The alternative feature DevicePlugins went beta in 1.10 (#60170).

Fixes #54012

```release-note
Support for "alpha.kubernetes.io/nvidia-gpu" resource which was deprecated in 1.10 is removed. Please use the resource exposed by DevicePlugins instead ("nvidia.com/gpu").
```
2018-04-03 02:02:04 -07:00
hangaoshuai 2674838826 add TestGeneration in customresource/etcd_test.go 2018-04-03 15:01:11 +08:00
Rohit Agarwal 87dda3375b Delete in-tree support for NVIDIA GPUs.
This removes the alpha Accelerators feature gate which was deprecated in 1.10.
The alternative feature DevicePlugins went beta in 1.10.
2018-04-02 20:17:01 -07:00
Christoph Blecker 857aac9ae4
Update gofmt for go1.10 2018-04-02 17:44:04 -07:00
rithu john 742bb5ea39 *: godep generated code 2018-04-02 15:15:11 -07:00
Christoph Blecker 0828b19996
Update godep in vendor 2018-04-02 12:57:41 -07:00
Kubernetes Submit Queue d371be33f7
Merge pull request #61380 from tossmilestone/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>.

Fix broken link

**What this PR does / why we need it**:
Fix broken link for `versioning.md`

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

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2018-04-02 06:18:35 -07:00
Kubernetes Submit Queue 66100690bc
Merge pull request #61949 from liggitt/tolerate-openapi
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>.

Tolerate 406 mime-type errors attempting to load new openapi schema

Fixes #61805
Fixes #61943 

```release-note
kubectl: improves compatibility with older servers when creating/updating API objects
```
2018-04-02 03:44:29 -07:00
Mikhail Mazurskiy 1f393cdef9
Stop() for Ticker to enable leak-free code 2018-03-31 19:41:43 +11:00
Kubernetes Submit Queue 7ce753aa73
Merge pull request #61894 from atlassian/misc-cleanups
Automatic merge from submit-queue (batch tested with PRs 61894, 61369). 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 range in loops; misc fixes

**What this PR does / why we need it**:
It is cleaner to use `range` in for loops to iterate over channel until it is closed.

**Release note**:
```release-note
NONE
```
/kind cleanup
2018-03-30 21:16:01 -07:00
Kubernetes Submit Queue ac8a02f5ed
Merge pull request #61816 from wackxu/rman
Automatic merge from submit-queue (batch tested with PRs 54997, 61869, 61816, 61909, 60525). 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 alpha annotation for volume node affinity

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

**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/kubernetes/issues/61785

**Special notes for your reviewer**:
/assign @msau42 

**Release note**:

```release-note
ACTION REQUIRED: Alpha annotation for PersistentVolume node affinity has been removed.  Update your PersistentVolumes to use the beta PersistentVolume.nodeAffinity field before upgrading to this release
```
2018-03-30 20:13:09 -07:00
Jordan Liggitt 51fb861b42
Tolerate 406 mime-type errors attempting to load new openapi schema 2018-03-30 22:11:27 -04:00
Kubernetes Submit Queue 6360192eab
Merge pull request #61847 from mengqiy/patch_conflict
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 patch conflict detection in apiserver

Patching conflict for merging list with mergeKey is not determined in the correct way. 

```release-note
None
```
2018-03-30 07:55:12 -07:00
Mengqi Yu ff18af452d fix patch conflict detection in apiserver 2018-03-29 20:05:58 -07:00
Kubernetes Submit Queue d23d523bcd
Merge pull request #61829 from jonyhy96/patch-4
Automatic merge from submit-queue (batch tested with PRs 61829, 61908, 61307, 61872, 60100). 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 comment error

fix comment error
```release-note
None
```
2018-03-29 17:37:06 -07:00
rithu john 7dc8b91aee tools/clientcmd: Remove gopass import 2018-03-29 17:24:45 -07:00
Kubernetes Submit Queue cad4385cb0
Merge pull request #61772 from php-coder/improve_kube_api_versions_error_message
Automatic merge from submit-queue (batch tested with PRs 61904, 61565, 61401, 61432, 61772). 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>.

Include original error in the error message

**What this PR does / why we need it**:
This PR improves error message by including an initial error into it.

Before this change `hack/test-update-storage-objects.sh` was failing with the following error:
>E0326 19:32:28.511136   31378 server.go:456] Failed to create clientset with KUBE_API_VERSIONS="v1,networking.k8s.io/v1,storage.k8s.io/v1beta1,extensions/v1beta1,networking.k8s.io/v1,storage.k8s.io/v1,extensions/v1beta1". KUBE_API_VERSIONS is only for testing. Things will break.

Now it shows also error cause:
> E0326 19:45:57.186959   18448 server.go:456] Failed to create clientset with KUBE_API_VERSIONS="v1,networking.k8s.io/v1,storage.k8s.io/v1beta1,extensions/v1beta1,networking.k8s.io/v1,storage.k8s.io/v1,extensions/v1beta1,policy/v1beta1": **group admissionregistration.k8s.io has not been registered**. KUBE_API_VERSIONS is only for testing. Things will break.
2018-03-29 11:46:22 -07:00
Mikhail Mazurskiy c23a8a85cc
Use range in loops; misc fixes 2018-03-29 22:55:25 +11:00
wackxu 11594333d2 remove AlphaStorageNodeAffinityAnnotation const 2018-03-29 09:33:15 +08:00
Kubernetes Submit Queue 8b6a4e14ff
Merge pull request #61777 from php-coder/psp_deprecate_api_in_extensions
Automatic merge from submit-queue (batch tested with PRs 61842, 61477, 61777). 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>.

Deprecate PSP-related types in extensions/v1beta1

**What this PR does / why we need it**:
This PR deprecates PSP-related types in `extensions/v1beta1` API Group and suggests to use their versions from `policy/v1beta1`. This is a part of PSP migration away from `extensions` API Group.

**Which issue(s) this PR fixes**:
Addressed to https://github.com/kubernetes/features/issues/5
2018-03-28 15:57:13 -07:00
Kubernetes Submit Queue 1a7a609cb1
Merge pull request #61769 from fisherxu/fixRCtoRS
Automatic merge from submit-queue (batch tested with PRs 60166, 61706, 61769). 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 to ReplicaSet in deployment api

**What this PR does / why we need it**:
Fix RC to ReplicaSet in deployment api
**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
```
2018-03-28 10:46:12 -07:00
Kubernetes Submit Queue 27df7d184b
Merge pull request #61757 from hanxiaoshuai/bugfix0327
Automatic merge from submit-queue (batch tested with PRs 61790, 61808, 60339, 61615, 61757). 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>.

check error when json.Unmarshal failed

**What this PR does / why we need it**:
check error when json.Unmarshal failed
**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
```
2018-03-28 09:39:21 -07:00
Kubernetes Submit Queue dea3c0a610
Merge pull request #61790 from deads2k/cli-21-scaler
Automatic merge from submit-queue (batch tested with PRs 61790, 61808, 60339, 61615, 61757). 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 reapers tolerate 404s on scaling down

fixes https://github.com/kubernetes/kubernetes/issues/61748

This fixes the scale client to return the actual API error, not a wrapped one.  It also updates scalers to do the same.  Then it fixes the reapers to tolerate 404s, since that means they achieved their objective.

/assign @janetkuo 
/assign @p0lyn0mial 

```release-note
NONE
```
2018-03-28 09:39:08 -07:00
David Eads 1272fda299 make reapers tolerate 404s on scaling down 2018-03-28 08:25:21 -04:00
Haoyun 0ace1c99e9
fix comment error
fix comment error
2018-03-28 17:56:25 +08:00
Kubernetes Submit Queue c8841cea30
Merge pull request #60592 from xmudrii/crd-tests
Automatic merge from submit-queue (batch tested with PRs 61402, 61143, 61427, 60592). 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: TestFinaliazationAndDeletion integration test

**What this PR does / why we need it**: This PR adds an integration test for [behavior described in the issue #60538 (comment)](https://github.com/kubernetes/kubernetes/issues/60538#issuecomment-369182483).

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

**Special notes for your reviewer**: This is based of the PR #60542, so this shouldn't be merged before that one. Tests are failing on the line 155, due to the timeout/non-nil error. I've tried to debug it furtherly, and found out that the CRD is still terminating. 

Actually, the CRD gets deleted, but it takes some time. For example, if you add `time.Sleep(x * time.Second)` on the line 152, the test would pass. The problem is this isn't predictable. With `x` of 6-10 seconds, I manage to get this test passing, but there's zero guarantees the CRD will get deleted for that 10 seconds.

I have found the `wait.Poll` function in some tests, but I'm not sure can it fix the problem I have.

This is my first PR to the Kubernetes project, so I could be missing something. Any idea is appreciated. :)

**Release note**:

```release-note
NONE
```

/sig api-machinery
/area custom-resources
/cc nikhita sttts liggitt
2018-03-27 15:33:15 -07:00
Marko Mudrinić 1178990767
apiexstension-apiserver: test cr finalization and deletion 2018-03-27 20:24:30 +02:00
Slava Semushin 9223f0d539 Update generated files. 2018-03-27 20:18:00 +02:00
Kubernetes Submit Queue f8981147e2
Merge pull request #61195 from grantr/use-race-free-fake-watcher
Automatic merge from submit-queue (batch tested with PRs 61195, 61479). 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 RaceFreeFakeWatcher in ObjectTracker to fix racy watch panics

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

The `FakeWatcher` added to `ObjectTracker` in #57504 allows sends on the result channel after it's closed; for example calling `Stop()` then `Add(obj)` will cause a panic. In my experience this has led to flaky tests when informers and controllers are running.

Replacing `FakeWatcher` with `RaceFreeFakeWatcher` fixes the problem, since `RaceFreeFakeWatcher` ignores additional events that occur after the watcher is stopped. It also panics instead of blocking when the result channel is full, which seems like a more useful behavior in tests than blocking.

I removed the `FakeWatchBufferSize` constant since `RaceFreeFakeWatcher` doesn't take a buffer size argument anymore. This seems fine since the `DefaultChanSize` constant is close to the `FakeWatchBufferSize` value (100 vs 128).

**Special notes for your reviewer**:

I can provide a minimal repro of a flaky test caused by the earlier behavior if necessary.

**Release note**:
```release-note
Fix racy panics when using fake watches with ObjectTracker
```
2018-03-27 11:04:03 -07:00
Slava Semushin 1725e2f5ee Deprecate PSP-related types in extensions/v1beta1 in favor of policy/v1beta1. 2018-03-27 17:29:11 +02:00
fisherxu 74c3c78204 autogenerate files 2018-03-27 22:07:37 +08:00
fisherxu b5b1b58675 fix RC to RS 2018-03-27 21:53:26 +08:00
Slava Semushin e976c4e233 Include original error in the error message. 2018-03-27 15:50:23 +02:00
Kubernetes Submit Queue 90c09c75d6
Merge pull request #61287 from deads2k/client-03-clientconfig
Automatic merge from submit-queue (batch tested with PRs 61644, 61624, 61743, 61019, 61287). 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>.

provide easy methods for direct kubeconfig loading from bytes

Adds a `RESTConfigFromKubeConfig([]byte)` method for taking a kubeconfig and getting back the rest.Config.  There are ways to do this now, but it takes a fair amount of wiring that is a pain.

As kube starts dropping `--master` flags from its commands, it will be able to use this.  For current consumers, this will be a big simplification.

```release-note
NONE
```
2018-03-27 06:41:23 -07:00
hangaoshuai ca7e263a29 check error when json.Unmarshal failed 2018-03-27 16:14:18 +08:00
Kubernetes Submit Queue c14767dba1
Merge pull request #61218 from hanxiaoshuai/clean0315
Automatic merge from submit-queue (batch tested with PRs 60519, 61099, 61218, 61166, 61714). 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 unused code authenticator/password/allow

**What this PR does / why we need it**:
remove unused code authenticator/password/allow
**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
```
2018-03-26 23:20:11 -07:00
Kubernetes Submit Queue fa14a79d35
Merge pull request #61099 from hanxiaoshuai/cleanup0313
Automatic merge from submit-queue (batch tested with PRs 60519, 61099, 61218, 61166, 61714). 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 unused func NewNamespacedNameFromString

**What this PR does / why we need it**:
remove unused func NewNamespacedNameFromString since v1.8.0
**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
```
2018-03-26 23:20:08 -07:00
Kubernetes Submit Queue 0f5f4597e0
Merge pull request #60779 from hanxiaoshuai/addut0305
Automatic merge from submit-queue (batch tested with PRs 61546, 61038, 61575, 60779, 61496). 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 some uts in helpers for CRD

**What this PR does / why we need it**:
add some uts in helpers for CRD
**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
```
2018-03-26 18:56:09 -07:00
p0lyn0mial 1f1d24005a removes custom scalers from kubectl 2018-03-26 19:33:42 +02:00
Kubernetes Submit Queue 86a58202b6
Merge pull request #57743 from CaoShuFeng/propagationPolicy
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 about DeleteOptions

Before this change:
```shell
$ curl -k  -XDELETE  -H "Accept: application/json" -H "Content-Type: application/json" -H "User-Agent: kubectl/v1.10.0 (linux/amd64) kubernetes/d7e5bd1" http://172.16.29.130:8080/apis/extensions/v1beta1/namespaces/default/deployments/nginx --data '{"propagationPolicy":"Background11111"}'
{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":" \"\" is invalid: []: Invalid value: v1.DeleteOptions{TypeMeta:v1.TypeMeta{Kind:\"\", APIVersion:\"\"}, GracePeriodSeconds:(*int64)(nil), Preconditions:(*v1.Preconditions)(nil), OrphanDependents:(*bool)(nil), PropagationPolicy:(*v1.DeletionPropagation)(0xc429aa9ed0)}: DeletionPropagation need to be one of \"Foreground\", \"Background\", \"Orphan\" or nil","reason":"Invalid","details":{"causes":[{"reason":"FieldValueInvalid","message":"Invalid value: v1.DeleteOptions{TypeMeta:v1.TypeMeta{Kind:\"\", APIVersion:\"\"}, GracePeriodSeconds:(*int64)(nil), Preconditions:(*v1.Preconditions)(nil), OrphanDependents:(*bool)(nil), PropagationPolicy:(*v1.DeletionPropagation)(0xc429aa9ed0)}: DeletionPropagation need to be one of \"Foreground\", \"Background\", \"Orphan\" or nil","field":"[]"}]},"code":422}
```
After this change:
```shell
$ curl -k  -XDELETE  -H "Accept: application/json" -H "Content-Type: application/json" -H "User-Agent: kubectl/v1.10.0 (linux/amd64) kubernetes/d7e5bd1" http://172.16.29.130:8080/apis/extensions/v1beta1/namespaces/default/deployments/nginx --data '{"propagationPolicy":"Background11111"}'
{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"DeleteOptions.meta.k8s.io \"\" is invalid: propagationPolicy: Unsupported value: \"Foreground1111\": supported values: \"Foreground\", \"Background\", \"Orphan\", \"nil\"","reason":"Invalid","details":{"group":"meta.k8s.io","kind":"DeleteOptions","causes":[{"reason":"FieldValueNotSupported","message":"Unsupported value: \"Foreground1111\": supported values: \"Foreground\", \"Background\", \"Orphan\", \"nil\"","field":"propagationPolicy"}]},"code":422}
```

**Release note**:
```
NONE
```
2018-03-26 02:57:03 -07:00
Kubernetes Submit Queue 433c01a7b7
Merge pull request #61553 from hongchaodeng/time
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>.

meta/v1: check error from json.Unmarshal()

Release note:
```
NONE
```
2018-03-25 21:34:10 -07:00
Kubernetes Submit Queue 02856b6656
Merge pull request #60996 from deads2k/server-09-metrics
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 metrics to true like it is for kube-apiserver

The kube-apiserver always hardcoded to true, but nothing else knew too.  I changed the default to true (I can't think of why you wouldn't want it even if you don't often use it).

@kubernetes/sig-api-machinery-bugs 
@MikeSpreitzer see if this fixes you?
2018-03-25 04:33:24 -07:00
Kubernetes Submit Queue 0b062e1518
Merge pull request #60452 from danwinship/networkpolicy-pod-plus-ns
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 including both podSelector and namespaceSelector in a NetworkPolicyPeer

Updates NetworkPolicy API docs and validation to allow podSelector and namespaceSelector to be specified together in a NetworkPolicyPeer

Fixes #58637

**Release note**:
```release-note
NetworkPolicies can now target specific pods in other namespaces by including both a namespaceSelector and a podSelector in the same peer element.
```
2018-03-24 13:34:27 -07:00
Kubernetes Submit Queue c4eac55ad5
Merge pull request #60836 from hanxiaoshuai/addut03061
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 unit test for function ParseKindArg and ParseGroupKind

**What this PR does / why we need it**:
add unit test for function ParseKindArg and ParseGroupKind
**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
```
2018-03-24 11:38:03 -07:00
Kubernetes Submit Queue 915798d229
Merge pull request #60563 from hzxuzhonghu/replace-context
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>.

Replace package "golang.org/x/net/context" with "context"

**What this PR does / why we need it**:
Replace package "golang.org/x/net/context" with "context"

**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 #60560

**Special notes for your reviewer**:
As of Go 1.7 this package(golang.org/x/net/context) is available in the standard library under the name context. see (https://godoc.org/golang.org/x/net/context)

It is almost machinery replace. 

**Release note**:

```release-note
NONE
```
2018-03-23 16:34:23 -07:00
Grant Rodgers b84ad8828b
Use RaceFreeFakeWatcher in ObjectTracker
The FakeWatcher allows sends on the result channel after it's closed,
for example calling Stop() then Add() will panic. RaceFreeFakeWatcher
checks whether the watcher is stopped before attempting to send. It also
panics instead of blocking when the result channel is full.
2018-03-22 16:31:53 -07:00
Hongchao Deng 32f3601fa4 meta/v1: check error from json.Unmarshal() 2018-03-22 11:02:34 -07:00
Kubernetes Submit Queue 52ed0368f8
Merge pull request #60056 from crassirostris/audit-version-switch
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>.

Make audit output version configurable.

This is a re-make of https://github.com/kubernetes/kubernetes/pull/51786, taken over form @soltysh 

Copying from the previous PR:

This is followup to https://github.com/kubernetes/kubernetes/pull/51719 to start the discussion how we want to solve the problem of users picking which version is being served them.

We need to have an option for log and webhook, separately. Probably, for webhook backend with multiple destinations we'd like to send different version to each.

This approach adds two flags (only the second commit matters), one for log and another for webhook (unfortunately global one). I've looked into kubeconfig types and although there are options to specify group and version they are meant for removal. @liggitt had some thoughts maybe he could share the ideas and we can pick it up here.

@ericchiang @CaoShuFeng @sttts opinions, thoughts are more than welcome

```release-note
Add apiserver configuration option to choose audit output version.
```
2018-03-22 09:12:14 -07:00
David Eads 456fd386dc update metrics to true like it is for kube-apiserver 2018-03-22 10:27:31 -04:00
hzxuzhonghu 70e45eccf2 Replace "golang.org/x/net/context" with "context" 2018-03-22 20:57:14 +08:00
Kubernetes Submit Queue e47280fca9
Merge pull request #61386 from hzxuzhonghu/remove-tls-ca-file
Automatic merge from submit-queue (batch tested with PRs 61354, 61366, 61386, 61394, 60755). 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 unused tls-ca-file flag

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

**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
Remove `--tls-ca-file` flag.
```
2018-03-21 23:44:13 -07:00
Kubernetes Submit Queue 18a7ea703b
Merge pull request #61354 from schylek/master
Automatic merge from submit-queue (batch tested with PRs 61354, 61366, 61386, 61394, 60755). 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/evanphx/json-patch

Updates github.com/evanphx/json-patch dependency
to fix handling tests against empty objects/arrays.

Includes fix from evanphx/json-patch#50
2018-03-21 23:44:07 -07:00
Kubernetes Submit Queue ef3539e69e
Merge pull request #60373 from sttts/sttts-1.10-cfssl
Automatic merge from submit-queue (batch tested with PRs 60373, 61098, 61352, 61359, 61362). 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>.

Bump cfssl to be compatible with Go 1.10
2018-03-21 22:39:09 -07:00
Kubernetes Submit Queue cba7843cb4
Merge pull request #60881 from hanxiaoshuai/addut0307
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 unit test for function FeatureGateSetFromMap and FeatureGateString

**What this PR does / why we need it**:
add unit test for function FeatureGateSetFromMap and FeatureGateString
**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
```
2018-03-21 21:17:51 -07:00
Kubernetes Submit Queue 09f321c80b
Merge pull request #61334 from dixudx/cobra_flag_terminate
Automatic merge from submit-queue (batch tested with PRs 60793, 61181, 61267, 61252, 61334). 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>.

bump spf13/cobra(c439c4): Terminate the stripping of flags when -- is found

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

spf13/cobra was recently bumped in #60689. The changes between then and now are:

* Terminate the stripping of flags when `--` is found: [spf13/cobra@c439c4](https://github.com/spf13/cobra/commit/c439c4)

**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 #61184

**Special notes for your reviewer**:
No license changes.

**Release note**:

```release-note
None
```
2018-03-21 20:23:21 -07:00
Kubernetes Submit Queue 092f1d52a7
Merge pull request #60792 from php-coder/psp_tiny_godoc_fix
Automatic merge from submit-queue (batch tested with PRs 61487, 58353, 61078, 61219, 60792). 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>.

PSP: godoc fixes

**What this PR does / why we need it**:
This PR fixes typos and wrong information along with updating comments to follow godoc convention.
2018-03-21 14:15:21 -07:00
Kubernetes Submit Queue e40ffd7197
Merge pull request #59172 from fisherxu/removeyear
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 YEAR field of all generated files and fix kubernetes boilerplate checker

**What this PR does / why we need it**:
Remove YEAR field of all generated files and fix kubernetes boilerplate checker
xref: [remove YEAR fileds in gengo #91](https://github.com/kubernetes/gengo/pull/91)

**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 [#gengo/issues/24](https://github.com/kubernetes/gengo/issues/24)

**Special notes for your reviewer**:
/cc @thockin @lavalamp @sttts 

**Release note**:

```release-note
NONE
```
2018-03-21 12:44:37 -07:00
Mik Vyatskov ad25d1f9ec Make advanced audit output version configurable.
Signed-off-by: Mik Vyatskov <vmik@google.com>
2018-03-21 17:29:05 +01:00
Dr. Stefan Schimanski 6a381aa053 Update staging godeps 2018-03-21 17:03:42 +01:00
Kubernetes Submit Queue f4398293a7
Merge pull request #61149 from hanxiaoshuai/fixtodo0314
Automatic merge from submit-queue (batch tested with PRs 61087, 61075, 61213, 61149, 60826). 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 unnecessary TODOs in meta.go

**What this PR does / why we need it**:
I notice there are TODOs in apimachinery\pkg\api\meta\meta.go,return bool instead of error func CommonAccessor, ListAccessor, Accessor. If is it necessary to do,I push a PR for it.
**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 #
[#61153](https://github.com/kubernetes/kubernetes/issues/61153)
**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-21 06:41:33 -07:00
Kubernetes Submit Queue d84c938da5
Merge pull request #61075 from tallclair/feature-owners
Automatic merge from submit-queue (batch tested with PRs 61087, 61075, 61213, 61149, 60826). 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>.

Grant sig leads feature approval powers

**What this PR does / why we need it**:
Sig leads already approve features for milestones and do a lot of code reviews. They should be able to approve changes to the associated feature gates, rather than needing to escalate every feature to root owners.

I omitted some sigs that shouldn't need to approve features in the base repo. LMK if I missed any, or these should be included in the approvers:

- AWS
- Azure
- Big Data
- Contributor Experience
- Docs
- GCP
- OpenStack
- Product Management
- Service Catalog
- Testing
- UI

For posterity, here's the script I used: https://gist.github.com/tallclair/1128aefa3186b0c3a8f4603929d2354e

**Special notes for your reviewer**:

@sig-leads: Please use responsibly :)

**Release note**:
```release-note
NONE
```
2018-03-21 06:41:27 -07:00
Kubernetes Submit Queue 8c1e171eec
Merge pull request #61087 from lcfang/test0313
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 check "d >= 0" since go 1.8 is no longer supported on master branch

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

remove check "d >= 0" since go 1.8 is no longer supported on master branch

**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
```
2018-03-21 06:39:34 -07:00
Slava Semushin 2b4a832585 Autogenerated changes. 2018-03-21 11:21:17 +01:00
Slava Semushin 4c1cb692c5 PSP: godoc fixes and improvements. 2018-03-21 11:10:40 +01:00
hzxuzhonghu 814401fc90 etcd client add dial timeout 2018-03-21 14:45:46 +08:00
Kubernetes Submit Queue 0254399884
Merge pull request #61105 from lcfang/test0313-2
Automatic merge from submit-queue (batch tested with PRs 57871, 61094, 60459, 61089, 61105). 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 the outdated TODO

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

remove the outdated TODO in [a7d6340ad2/staging/src/k8s.io/apiserver/pkg/registry/rest/meta.go (L42))

**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
```
2018-03-20 23:34:42 -07:00
Kubernetes Submit Queue ad432fa6bd
Merge pull request #60971 from CaoShuFeng/audit_throttle_burst
Automatic merge from submit-queue (batch tested with PRs 60919, 60953, 61085, 61083, 60971). 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>.

[advanced audit]fix comment about throttle burst

/assign @sttts

**Release note**:
```release-note
NONE
```
2018-03-20 20:34:38 -07:00
Kubernetes Submit Queue 32d6a9356d
Merge pull request #61083 from hzxuzhonghu/bug-fix-0313
Automatic merge from submit-queue (batch tested with PRs 60919, 60953, 61085, 61083, 60971). 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 apiserver.k8s.io RootScopedKinds

RootScopedKinds in group ` apiserver.k8s.io` should be `AdmissionConfiguration`

**Release note**:

```release-note
NONE
```
2018-03-20 20:34:35 -07:00
Kubernetes Submit Queue 4c8657c087
Merge pull request #61003 from CaoShuFeng/amdission_controller_glog_v2
Automatic merge from submit-queue (batch tested with PRs 61003, 61031, 60360, 58349, 60922). 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 enabled admission controller in order

This change log enabled mutating and validating admission controller
in order.

ref: https://github.com/kubernetes/kubernetes/pull/60838/files#r173295334



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

**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
```
2018-03-20 18:34:26 -07:00
Kubernetes Submit Queue 691a7d4358
Merge pull request #60759 from hzxuzhonghu/etcd-flag-validate
Automatic merge from submit-queue (batch tested with PRs 60759, 60531, 60923, 60851, 58717). 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>.

validate EtcdOptions.EtcdServersOverrides in EtcdOptions.Validate

move `EtcdOptions.EtcdServersOverrides` validation from `BuildStorageFactory` to `EtcdOptions.Validate`, which fails fast in kube-apiserver startup.

**Release note**:

```release-note
NONE
```
2018-03-20 15:34:27 -07:00
Kubernetes Submit Queue de1a0e3249
Merge pull request #60925 from aleksandra-malinowska/debug-curl-fix
Automatic merge from submit-queue (batch tested with PRs 60696, 60876, 60901, 60925, 60428). 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 debug curl command

When logging debug curl command, add single quotes around URL and headers. This prevents quietly removing any parameters after '&' when running resulting command and improves formatting.

```release-note
NONE
```
2018-03-20 13:36:21 -07:00
Kubernetes Submit Queue 7543ddde4c
Merge pull request #60901 from ixdy/client-go-bazel
Automatic merge from submit-queue (batch tested with PRs 60696, 60876, 60901, 60925, 60428). 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/util/cert go_library shouldn't depend on testdata

**What this PR does / why we need it**: 981dd8dc66 (diff-eb996d3ca3a215d7d93faaaffb77dbd7) accidentally added a testdata dependency on the go_library rule, rather than the go_test. This breaks vendoring of this rule into other bazel projects that prune out tests and testdata.

Only the unit test depends on testdata, so the BUILD file should reflect that, too.

x-ref https://github.com/kubernetes/test-infra/pull/6835#discussion_r173010769

**Release note**:

```release-note
NONE
```

cc @BenTheElder @krzyzacy
2018-03-20 13:36:18 -07:00
Kubernetes Submit Queue f44f7dffa2
Merge pull request #60696 from wrfly/patch-1
Automatic merge from submit-queue (batch tested with PRs 60696, 60876, 60901, 60925, 60428). 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 non-nil ptr in struct convert

**What this PR does / why we need it**:
Fix an issue.

**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 #35335

**Special notes for your reviewer**:
Thanks for other contributer's debug.

**Release note**:

```release-note
NONE
```
2018-03-20 13:36:10 -07:00
Kubernetes Submit Queue e6ba628b07
Merge pull request #60855 from cheftako/local-up
Automatic merge from submit-queue (batch tested with PRs 60710, 60855, 60873, 60895, 60862). 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 local cluster leaking memory.

**What this PR does / why we need it**:
Local cluster is leaking memory due to mutation detector being enabled.
In addition there is no warning in the logs that this could be the
issue.
Added a log warning when this feature is enabled to make debugging this
issue easier for other cases of this.

**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 #60854 

**Special notes for your reviewer**:

**Release note**:
```release-note
None
```
2018-03-20 10:34:37 -07:00
Kubernetes Submit Queue e2f6bd672d
Merge pull request #60489 from yue9944882/remove-redundant-fake-discovery
Automatic merge from submit-queue (batch tested with PRs 59637, 60611, 60788, 60489, 60687). 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 redundant fake discovery code

**Special notes for your reviewer**:
This PR removes fake discovery from `testing` package.
It is already moved to:
[9c57bf74b3/staging/src/k8s.io/client-go/discovery/fake/discovery.go (L34))


**Release note**:

```release-note

```
2018-03-20 04:34:43 -07:00
Maciej Szulik 3c5aad0d6f
Generated changes 2018-03-20 12:20:32 +01:00
Maciej Szulik adee7dafac
RoundTrip tests in the k8s/api repository 2018-03-20 12:18:05 +01:00
hzxuzhonghu fffa40552c remove unused code 2018-03-20 18:50:48 +08:00
hzxuzhonghu ea627f9875 check etcd servers by a random order 2018-03-20 18:50:46 +08:00
Kubernetes Submit Queue 18d9e1c450
Merge pull request #60702 from hzxuzhonghu/kube-apiserver-cleanup
Automatic merge from submit-queue (batch tested with PRs 60363, 59208, 59465, 60581, 60702). 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 clean code

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

1. clean up some redundant code in kube-apiserver startup

1. comment on `preparedGenericAPIServer`, which is just a wrapper of `GenericAPIServer`.



**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-20 02:37:26 -07:00
hangaoshuai c63e22eea5 catch err when Watch testResource failed in func TestWatchCallNonNamespace 2018-03-20 16:35:41 +08:00
hzxuzhonghu 9c0803e14c remove unused rls-ca-file flag 2018-03-20 15:26:31 +08:00
Kubernetes Submit Queue 5be9578e34
Merge pull request #58731 from yue9944882/feature/beginport-and-offset-expr-port-range
Automatic merge from submit-queue (batch tested with PRs 60457, 60331, 54970, 58731, 60562). 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>.

implement begin-port+offset port range parsing

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

Allocate specific numbers of port from a host by indicating a begin port and its offsets.
This can be used for kube-proxy configuration.

**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 #58730

**Special notes for your reviewer**:

**Release note**:

```release-note
"beginPort+offset" format support for port range which affects kube-proxy only
```
2018-03-19 23:42:18 -07:00
Kubernetes Submit Queue c64f19dd1b
Merge pull request #59728 from wgliang/master.append
Automatic merge from submit-queue (batch tested with PRs 59740, 59728, 60080, 60086, 58714). 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>.

more concise to merge the slice

**What this PR does / why we need it**:
more concise to merge the slice

**Special notes for your reviewer**:
2018-03-19 21:34:30 -07:00
Shaw Ho 9b278d20e3
Fix broken link 2018-03-20 11:08:06 +08:00
Kubernetes Submit Queue eefd72557e
Merge pull request #53880 from wackxu/kubeconfig
Automatic merge from submit-queue (batch tested with PRs 51423, 53880). 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>.

prevent the same path load multiple times

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

prevent the same path load multiple times,if there are several same path, we only load one time

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-19 19:35:26 -07:00
Slawomir Chylek 758d3e7c57 vendor: Update github.com/evanphx/json-patch
Updates github.com/evanphx/json-patch dependency
to fix tests against empty objects/arrays.

Includes fix from evanphx/json-patch#50
2018-03-19 15:39:16 +01:00
Di Xu 87cfc33b14 bump spf13/cobra(c439c4): Terminate the stripping of flags when -- is found 2018-03-19 21:32:39 +08:00
Dr. Stefan Schimanski 50b98169ed apiserver: add warning about not trusting authz of aggregator 2018-03-19 13:41:42 +01:00
Cao Shufeng e87c2c9f27 Log rbac info into advanced audit event 2018-03-19 08:37:53 +08:00
David Eads 8eec665ecc provide easy methods for direct kubeconfig loading from bytes 2018-03-16 12:28:50 -04:00
immutablet 04a6613fb5 Instrument transformer.go with latency metrics. 2018-03-15 14:13:24 -07:00
hangaoshuai bf44c29932 remove unused code authenticator/password/allow 2018-03-15 17:14:28 +08:00
hangaoshuai 4fea1687f6 remove unnecessary TODOs in meta.go 2018-03-15 15:44:23 +08:00
Kubernetes Submit Queue c13d9ffea9
Merge pull request #60739 from tallclair/audit-buffer
Automatic merge from submit-queue (batch tested with PRs 60737, 60739, 61080, 60968, 60951). 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 default auditing options.

- Log backend defaults to blocking mode (backwards compatability)
- Webhook backend defaults to throttled
- Fix webhook validation
- Add options test

**Which issue(s) this PR fixes**:
Fixes #60719

**Special notes for your reviewer**:
This PR is an alternative fix to https://github.com/kubernetes/kubernetes/pull/60727. If the rollback goes in first, I'll rebase this on a roll-forward.

**Release note**:
-->
```release-note
NONE
```
2018-03-13 12:26:57 -07:00
Kubernetes Submit Queue b651ed5ea7
Merge pull request #60998 from jpbetz/etcd-3.1.12
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>.

Bump to etcd 3.1.12 to pick up critical fix

etcd [3.1.12](https://github.com/coreos/etcd/releases/tag/v3.1.12) (as well as 3.2.17 and 3.3.2) was released yesterday to fix a bug critical to kubernetes:

Fix [mvcc "unsynced" watcher restore operation](https://github.com/coreos/etcd/pull/9297).
- "unsynced" watcher is watcher that needs to be in sync with events that have happened.
- That is, "unsynced" watcher is the slow watcher that was requested on old revision.
- "unsynced" watcher restore operation was not correctly populating its underlying watcher group.
- Which possibly causes [missing events from "unsynced" watchers](https://github.com/coreos/etcd/issues/9086).

This will be backported to 1.9 as well.

Release note:
```release-note
Upgrade the default etcd server version to 3.1.12 to pick up critical etcd "mvcc "unsynced" watcher restore operation" fix.
```

cc @gyuho @wojtek-t @shyamjvs @timothysc @jdumars
2018-03-13 09:11:10 -07:00
Kubernetes Submit Queue 25c8871bd0
Merge pull request #61004 from CaoShuFeng/audit_webhook_initialBackoff
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 option --audit-webhook-initial-backoff

Before this change, --audit-webhook-initial-backoff has no effect

@crassirostris @sttts 



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

**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
```
2018-03-13 08:07:14 -07:00
lcfang 9be76ec461 remove the outdated TODO 2018-03-13 20:31:01 +08:00
hangaoshuai 04862d7829 remove unused func NewNamespacedNameFromString 2018-03-13 19:34:17 +08:00
lcfang 93aa73e492 remove check d >= 0 since go 1.8 is no longer supported on master branch 2018-03-13 15:22:30 +08:00
hzxuzhonghu f66c9b388f fix bug in apiserver.k8s.io install 2018-03-13 14:47:05 +08:00
Tim Allclair 9afc4242d3 Grant sig leads feature approval powers 2018-03-12 11:34:33 -07:00
Maciej Szulik f4802a15b7
Roundtrip test helper for external types 2018-03-12 15:58:05 +01:00
Kubernetes Submit Queue fd3cbc9bbf
Merge pull request #60995 from caesarxuchao/webhook-serializer
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>.

Let webhook controller uses a local scheme that understand admissionReview

An alternative to #60965.
Fix #60963.
Fix kubernetes/sample-apiserver#21.

Created a scheme that only understands admission/v1beta1 and use it to
encode/decode admissionReviews.

cc @sttts
2018-03-12 07:02:27 -07:00
Cao Shufeng 5bc5cd1b2c fix option --audit-webhook-initial-backoff
Before this change, --audit-webhook-initial-backoff has no effect
2018-03-10 17:50:57 +08:00
Cao Shufeng 76aaba6d24 log enabled admission controller in order
This change log enabled mutating and validating admission controller
in order.
2018-03-10 16:20:12 +08:00
Joe Betz e2a25f9b54 Bump to etcd 3.1.12 to pick up critical fix 2018-03-09 14:28:23 -08:00
Chao Xu 3ab516035d Make admission webhooks work in custom apiservers.
Created a scheme that only understands admission/v1beta1 and use it to
encode/decode admissionReviews.

Also made the NegotiationSerializer setup static
2018-03-09 13:54:27 -08:00
Cao Shufeng c6f72c20d1 [advanced audit]fix comment about throttle burst 2018-03-09 22:31:02 +08:00
yue9944882 68ad76bf53 move enum into function local 2018-03-09 14:20:58 +08:00
Kubernetes Submit Queue 71b40cbce5
Merge pull request #60943 from jennybuckley/webhook-https-url
Automatic merge from submit-queue (batch tested with PRs 60906, 60943). 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 admission webhooks honor scheme part of url

**What this PR does / why we need it**:
Bug fix, allow webhooks to use the scheme provided in clientConfig, instead of defaulting to http.
(more in issue)

**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 #60942

```release-note
Bug fix, allow webhooks to use the scheme provided in clientConfig, instead of defaulting to http.
```

/kind bug
/sig api-machinery
2018-03-08 15:18:46 -08:00
Kubernetes Submit Queue 56195fd1d3
Merge pull request #60891 from shyamjvs/go-back-to-etcd-3.1.10
Automatic merge from submit-queue (batch tested with PRs 60891, 60935). 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>.

Rollback etcd server version to 3.1.11 due to #60589

Ref https://github.com/kubernetes/kubernetes/issues/60589#issuecomment-371171837

The dependencies were a bit complex (so many things relying on it) + the version was updated to 3.2.16 on top of the original bump.
So I had to mostly make manual reverting changes on a case-by-case basis - so likely to have errors :)

/cc @wojtek-t @jpbetz 

```release-note
Downgrade default etcd server version to 3.1.11 due to #60589
```

(I'm not sure if we should instead remove release-notes of the original PRs)
2018-03-08 12:45:46 -08:00
jennybuckley 7d5696eb6d Make admission webhooks not ignore scheme 2018-03-08 11:35:13 -08:00
Tim Allclair e004257919 Fix default auditing options.
- Log backend defaults to blocking mode (backwards compatability)
- Fix webhook validation
- Add options test
2018-03-08 11:03:44 -08:00
Aleksandra Malinowska 42f756aeb0 Improve debug curl command 2018-03-08 13:56:44 +01:00
Shyam Jeedigunta 21f5e69f08 Rollback etcd server version to 3.1.11 due to #60589 2018-03-08 13:07:15 +01:00
hangaoshuai 95eaccb095 add unit test for function FeatureGateSetFromMap and FeatureGateString 2018-03-08 18:52:36 +08:00
fisherxu 93b9b82cae fix boilerplate checker of kubernetes/kubernetes
update bazel and remove passing golint packages
2018-03-08 17:52:49 +08:00
fisherxu b49ef6531c regenerated all files and remove all YEAR fields 2018-03-08 17:52:48 +08:00
fisherxu 32319d6ef7 add boilerplate.generatego.txt and let all code-generators use it
remove YEAR field in boilerplate under staging

add Do Not Edit for types_swagger_doc and add apiextensions-apiserver's example in codegen.sh
2018-03-08 17:52:44 +08:00
hangaoshuai 177afe55c0 add unit test for function ParseKindArg and ParseGroupKind 2018-03-08 09:24:18 +08:00
Kubernetes Submit Queue a0844c17bf
Merge pull request #60682 from hanxiaoshuai/update0302
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 Mount propagation version in comment

**What this PR does / why we need it**:
Mount propagation feature was moved to beta in PR [#59252](https://github.com/kubernetes/kubernetes/pull/59252), so update the comment.
**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 #60657 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-07 17:20:04 -08:00
Jeff Grafton 4c60b776fc client-go/util/cert go_library shouldn't depend on testdata 2018-03-07 14:48:53 -08:00
Kubernetes Submit Queue bad8e0d91c
Merge pull request #60838 from CaoShuFeng/amdission_controller_glog
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 enabled admission controller in order

After switching to --enable-admission-plugins/--disable-admission-plugins, some admission controller may start silently. And these admission controllers may modify or forbid objects. This pull request does a lot of help for admin to trouble shooting.

/assign @hzxuzhonghu @sttts 

**Release note**:
```release-note
NONE
```
2018-03-07 11:21:13 -08:00
Cao Shufeng 4c6db2516a log enabled admission controller in order 2018-03-07 10:18:11 +08:00
Kubernetes Submit Queue f196b7c752
Merge pull request #60805 from ericchiang/oidc-owners
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>.

oidc: add rithujohn191 as a reviewer

cc @rithujohn191

/sig auth
/kind documentation

```release-note
NONE
```
2018-03-06 16:04:42 -08:00