Commit Graph

732 Commits

Author SHA1 Message Date
Kubernetes Publisher 43af965c71 Merge pull request #49321 from dgoodwin/export-wiring
Automatic merge from submit-queue (batch tested with PRs 49615, 49321, 49982, 49788, 50355)

Fix unused Secret export logic.

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

The strategy used for the secret store defined custom export logic, and
had accompanying unit tests. However the secret storage did not actually
wire this up by setting an ExportStrategy and thus the code was never
used in the real world.

This change fixes the missing assignment and adds testing at a higher
level to ensure any uses of the generic registry.Store that we expect to
have an ExportStrategy do, and no others.

Several other strategies in the RBAC package also appeared to have
unwired Export logic, however their implementations were all empty
leading me to believe that these are not considered exportable. The
empty methods have now been removed.

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

**Release note**:

```release-note
```

Kubernetes-commit: f6d90eaa456bafa12e6287abda5a8d8c5bbf893c
2017-08-09 23:56:00 -07:00
Kubernetes Publisher 7e2b09280d Merge pull request #50328 from shiywang/selflink
Automatic merge from submit-queue (batch tested with PRs 50300, 50328, 50368, 50370, 50372)

Add unit tests for GenerateLink

Fixes https://github.com/kubernetes/kubernetes/issues/48321
cc @lavalamp

```release-note
NONE
```

Kubernetes-commit: 9466dbb4ab374652469db5fee6f7b365a0575e01
2017-08-29 13:15:22 +00:00
Devan Goodwin f2bea1dce9 Fix unused Secret export logic.
The strategy used for the secret store defined custom export logic, and
had accompanying unit tests. However the secret storage did not actually
wire this up by setting an ExportStrategy and thus the code was never
used in the real world.

This change fixes the missing assignment and adds testing at a higher
level to ensure any uses of the generic registry.Store that we expect to
have an ExportStrategy do, and no others.

Several other strategies in the RBAC package also appeared to have
unwired Export logic, however their implementations were all empty
leading me to believe that these are not considered exportable. The
empty methods have now been removed.

Kubernetes-commit: 855a1c17131f92fca6de33279a02eca3893ca374
2017-08-29 13:15:22 +00:00
Kubernetes Publisher f0085e9ad7 Merge pull request #50254 from liggitt/revert-disk-cache
Automatic merge from submit-queue (batch tested with PRs 50254, 50174, 50179)

Revert "Merge pull request #47353 from apelisse/http-cache"

Some issues were discovered with the caching merged in #47353:
* uses a disk-based cache that is not safe between processes (does not use atomic fs operations)
* writes get/list responses to disk that should not be cached (like `kubectl get secrets`)
* is vulnerable to partially written cache responses being used as responses to future requests
* breaks uses of the client transport that make use of websockets
* defaults to enabling the cache for any client builder using RecommendedConfigOverrideFlags or DefaultClientConfig which affects more components than just kubectl

This reverts commit fc89743dca6b563063b74728c3b28100cf674d9d, reversing changes made to 29ab38e898988c36e2de34f77fa33be556eb21bd.

Kubernetes-commit: 187e6ab0bc35f696d8f5f574fab9aa457f253d34
2017-08-29 13:15:22 +00:00
Shiyang Wang 0fb974784d Add unittests for GenerateLink
Kubernetes-commit: a835d5bdd2747f3e799ab470bd2e2f14ee0fb52a
2017-08-29 13:15:22 +00:00
Jordan Liggitt 4661d61624 Revert "Merge pull request #47353 from apelisse/http-cache"
This reverts commit fc89743dca6b563063b74728c3b28100cf674d9d, reversing
changes made to 29ab38e898988c36e2de34f77fa33be556eb21bd.

Kubernetes-commit: 4ee72eb300423772020dd1cf208159058ba7dab5
2017-08-29 13:14:39 +00:00
Kubernetes Publisher 1cbe8b85c9 sync: reset Godeps/Godeps.json 2017-08-29 13:14:39 +00:00
Kubernetes Publisher f0707edd13 Merge pull request #49377 from CaoShuFeng/audit_id_http_response_header
Automatic merge from submit-queue (batch tested with PRs 49868, 50143, 49377, 50141, 50145)

Return Audit-Id http response header for trouble shooting

Users can use Audit-Id http response header to grep the audit events in log.
This provides a fast way to find the events in audit.
**Release note**:

```
Audit-Id HTTP header is included in the apiserver responses for audited requests, except some cases when it's not possible, e.g. pods/exec.
```
@sttts @tallclair

Kubernetes-commit: a0826e1d89a45414598138547ebcc9a87aef9448
2017-08-07 04:04:57 -07:00
Cao Shufeng 4ace90bfb4 Return Audit-Id http header for trouble shooting
Kubernetes-commit: 4a1e7ddaa6e0d2e92ce27d9846cfc8407e1fcb60
2017-08-29 13:14:38 +00:00
Kubernetes Publisher f43e4c3c30 Merge pull request #49868 from shiywang/testlog
Automatic merge from submit-queue (batch tested with PRs 49868, 50143, 49377, 50141, 50145)

Status objects for 404 API errors will have the correct APIVersion

Fixes https://github.com/kubernetes/kubernetes/issues/48959
superseded https://github.com/kubernetes/kubernetes/pull/49183


```release-note 
Status objects for 404 API errors will have the correct APIVersion
```

Kubernetes-commit: fb661268ffc56567710e5772d949a6669d88fed8
2017-08-07 04:04:53 -07:00
Kubernetes Publisher 0e4f9d22d1 Merge pull request #50159 from liggitt/includeObject
Automatic merge from submit-queue

Fix includeObject parameter parsing

Fixes #50149

Kubernetes-commit: c75d3028dda35e25603aad580326385b8d141f93
2017-08-29 13:14:38 +00:00
Shiyang Wang 33ec851d32 Fix NotFound errors do not line up with API endpoint's group version
Kubernetes-commit: 2eda19da7be9b8e0fad294bf902684f23a795dd2
2017-08-29 13:14:38 +00:00
Jordan Liggitt f5f8465637 Fix includeObject parameter parsing
Kubernetes-commit: a7a551148071bb4d87f73c7b6c0f4bd7cc829b22
2017-08-29 13:14:38 +00:00
Kubernetes Publisher 787b46c230 Merge pull request #49915 from caesarxuchao/controller-ignore-initialize-timeout
Automatic merge from submit-queue (batch tested with PRs 49855, 49915)

Let controllers ignore initialization timeout when creating pods

Partially address https://github.com/kubernetes/kubernetes/issues/48893#issuecomment-318540129.

This only updates the controllers that create pods with `GenerateName`.

The controllers ignore the timeout error when creating the pods, depending on how the initialization progress:
* If the initialization is successful in less than 5 mins, the controller will observe the creation via the informer. All is good.
* If the initialization fails, server will delete the pod, but the controller won't receive any event. The controller will not create new pod until the Creation expectation expires in 5 min.
* If the initialization takes too long (> 5 mins), the Creation expectation expires and the controller will create extra pods.

I'll send follow-up PRs to fix the latter two cases, e.g., by refactoring the sharedInformer.

Kubernetes-commit: f75f49e7a03700b5b300e9ccb61d434487bb0ccc
2017-08-05 19:07:53 -07:00
Kubernetes Publisher 7dd46577b6 Merge pull request #49678 from smarterclayton/429_metric
Automatic merge from submit-queue

Timeout and Max-in-flight don't report non-resource URLs correctly.

Unify error reporting for 429 and 504 to be correct for timeout and max in flight and eviction. Add better messages to eviction (removing a todo). Return the correct body content for timeouts (reason and code should be correct).

This potentially increases cardinality of 429, but because non-api urls may be under the max-inflight budget we need to report them somewhere (if something breaks and starts fetching API versions endlessly).

```release-note
The 504 timeout error was returning a JSON error body that indicated it was a 500.  The body contents now correctly report a 500 error.
```

Kubernetes-commit: 8d6bbaa85f96f14ac9c9722ed1677e1052c974ba
2017-08-29 13:14:37 +00:00
Chao Xu aea323d020 Let controllers ignore initialization timeout error when creating a pod.
Kubernetes-commit: 97e07e5b52d310ac24d1d46572a4435e694a48f8
2017-08-29 13:14:37 +00:00
Clayton Coleman 0d288373d0 SuggestClientDelay is not about retrying, clarify message and header
SuggestClientDelay is returning whether the server has requested that
the client delay their next action. It is *not* about whether the client
should retry the action. Webhook was using it incorrectly, and the
method is now up to date.

Kubernetes-commit: 04846cc25b862c1eabff03ea0b11cbf2f7fae8e2
2017-08-29 13:14:37 +00:00
Clayton Coleman c685a3bb9c generated: bazel
Kubernetes-commit: 1ebbce2f6cad617a53225478efd4ffde30741475
2017-08-29 13:14:37 +00:00
Kubernetes Publisher 265b663b44 Merge pull request #47353 from apelisse/http-cache
Automatic merge from submit-queue

go-client: Use httpcache client for all requests, even though only openapi returns ETags for caching

**What this PR does / why we need it**: Use HTTP ETag for caching Swagger spec download

This also adds a new command-line flag "cachedir" to specify where the cache should keep its file. It defaults to `$HOME/.kube/http-cache`.

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

**Special notes for your reviewer**:
Because this adds a bunch of dependencies, and removes a couple of files, I do recommend reading each commit individually.

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

Kubernetes-commit: fc89743dca6b563063b74728c3b28100cf674d9d
2017-08-29 13:14:36 +00:00
Clayton Coleman 8ba1feb05c Timeout filter returns 504 and an inconsistent error body
Our rules are that code of the error must match code of the response. We
were also not setting the correct reason. This updates the timeout
filter to be consistent with other clients, without changing the error
code (504 is correct). The new message properly indicates the request
may still be running, which the old message did not do.

Kubernetes-commit: 74f6669b4983a9295dc0549ad15e44d70a18cc8f
2017-08-29 13:14:36 +00:00
Clayton Coleman 19ee3e9e2f Report non-resource URLs in max-in-flight correctly
This potentially has high cardinality, however we can rate limit based
on queries to these endpoints as well.

Kubernetes-commit: 022a5463dcf20126b02e9d9f797ea1e589de1dd1
2017-08-29 13:14:36 +00:00
Clayton Coleman 139dfbd0e1 Update generic errors with the new http package codes
All of these errors are now part of the standard HTTP method. Formalize
those into our error types and remove duplication and unclear
separation.

Kubernetes-commit: d3be1ac92eb644e284915a55fe67942c33f88d4c
2017-08-29 13:14:36 +00:00
Antoine Pelisse a3596c5884 c-go: Add dependencies for http-cache
Kubernetes-commit: e77d298f83114318fabce9f36546c9f6a7c24938
2017-08-29 13:13:52 +00:00
Kubernetes Publisher 02bf6f13d2 sync: reset Godeps/Godeps.json 2017-08-29 13:13:52 +00:00
Kubernetes Publisher 17d4558e90 Merge pull request #50019 from deads2k/server-38-storage
Automatic merge from submit-queue (batch tested with PRs 48237, 50084, 50019, 50069, 50090)

create default storage selection functions

The vast majority of our REST storage needs either default selection predicates or minor tweaks the the field selection criteria.  This pull makes that work without any special fields set, but also allows the more complex configuration where it is required.  I only changed one storage an example.  Once this merges, I'll update the others.

@kubernetes/sig-api-machinery-misc @wojtek-t @smarterclayton @sttts @cheftako ptal.

Kubernetes-commit: 65e6bf8d76f54851c1e57c40ce33f69a5f854543
2017-08-03 22:22:00 -07:00
Kubernetes Publisher d3f9123b11 Merge pull request #48969 from ixdy/update-kazel
Automatic merge from submit-queue (batch tested with PRs 50103, 49677, 49449, 43586, 48969)

Run kazel on the entire tree

**What this PR does / why we need it**: part of #47558: auto-generate `BUILD` files on the entire tree, since this is what `gazelle` does, and it'll make subsequent reviews easier if less is changing.

**Release note**:

```release-note
NONE
```
/assign
/release-note-none

Kubernetes-commit: d15baf69e10f3eddd59da2f6972a723a08e7dac7
2017-08-29 13:13:51 +00:00
deads2k d1afbac635 create default storage selection functions
Kubernetes-commit: 0258d044d3b46f5d2e6bf30658afd4f29e48a1ca
2017-08-29 13:13:51 +00:00
Jeff Grafton 44942b068a Run hack/update-bazel.sh to generate BUILD files
Kubernetes-commit: 3579017b865ddbc5449d6bba87346f086e4b93ff
2017-08-29 13:13:51 +00:00
Kubernetes Publisher d2fadad05c Merge pull request #49677 from dims/send-missing-uid-field-during-webhook-authorize
Automatic merge from submit-queue (batch tested with PRs 50103, 49677, 49449, 43586, 48969)

Add missing UID in SubjectAccessReviewSpec

**What this PR does / why we need it**:
WebhookAuthorizer's Authorize should send *all* the information
present in the user.Info data structure. We are not sending the
UID currently.


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

**Special notes for your reviewer**:

**Release note**:

```release-note
The SubjectAccessReview API in the authorization.k8s.io API group now allows providing the user uid.
```

Kubernetes-commit: 40d66b8e05ec7d4dd5bfe03d9f76ace4d4ad34da
2017-08-03 16:43:34 -07:00
Kubernetes Publisher 2c66dfcbee Merge pull request #49195 from huangjiuyuan/fix-typo
Automatic merge from submit-queue

fix typo in staging/src/k8s.io/apiserver/pkg/server/config.go

**What this PR does / why we need it**: Fix a typo `It's members are sorted roughly in order of importance for composers.` in `staging/src/k8s.io/apiserver/pkg/server/config.go`.

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

**Special notes for your reviewer**:

**Release note**:

`NONE`

Kubernetes-commit: 2bd0b3dd2616e5c4a6ef79d08dfb8bc8f5959ced
2017-08-29 13:13:50 +00:00
Davanum Srinivas 7d27fa3fec Add missing UID in SubjectAccessReviewSpec
WebhookAuthorizer's Authorize should send *all* the information
present in the user.Info data structure. We are not sending the
UID currently.

Kubernetes-commit: 9a761b16c1558106800222dbc52f6ab03c40c64c
2017-08-29 13:13:50 +00:00
Kubernetes Publisher 06ea0476f0 Merge pull request #49300 from tklauser/syscall-to-x-sys-unix
Automatic merge from submit-queue

Switch from package syscall to golang.org/x/sys/unix

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

The syscall package is locked down and the comment in https://github.com/golang/go/blob/master/src/syscall/syscall.go#L21-L24 advises to switch code to use the corresponding package from golang.org/x/sys. This PR does so and replaces usage of package syscall with package golang.org/x/sys/unix where applicable. This will also allow to get updates and fixes
without having to use a new go version.

In order to get the latest functionality, golang.org/x/sys/ is re-vendored. This also allows to use Eventfd() from this package instead of calling the eventfd() C function.

**Special notes for your reviewer**:

This follows previous works in other Go projects, see e.g. moby/moby#33399, cilium/cilium#588

**Release note**:

```release-note
NONE
```

Kubernetes-commit: 5d24a2c19923d6da46110b827619f4b21cf689ac
2017-08-29 13:13:50 +00:00
huangjiuyuan c229fe60e4 fix typo in staging/src/k8s.io/apiserver/pkg/server/config.go
Kubernetes-commit: 1382d2f6e8baa2342e2b117b527d4b74d3b539ee
2017-08-29 13:13:50 +00:00
Kubernetes Publisher fa9e59055b Merge pull request #49302 from sttts/sttts-missing-codecs
Automatic merge from submit-queue

Add missing ugorji codecs for auth/v1, settings/v1alphav1 and storage/v1

Kubernetes-commit: f8affc7dcc9e227b5d883d2322105be779d22125
2017-08-29 13:13:07 +00:00
Tobias Klauser 98556d38c2 bump(golang.org/x/sys): 7a4fde3fda8ef580a89dbae8138c26041be14299
Kubernetes-commit: 1fd18181ab38a6d65cda26f53b7e4d95f6009878
2017-08-29 13:13:07 +00:00
Dr. Stefan Schimanski 4f763bd819 Add missing ugorji codecs for auth/v1, settings/v1alphav1 and storage/v1
Kubernetes-commit: 51df7cf59de2a7fbaad61e4a1a13598668028de5
2017-08-29 13:13:07 +00:00
Kubernetes Publisher 29ed962d0a sync: reset Godeps/Godeps.json 2017-08-29 13:13:07 +00:00
Kubernetes Publisher 81d0a552d0 Merge pull request #49972 from deads2k/server-37-log
Automatic merge from submit-queue

remove dead log handler and increase verbosity

We had a handler that no one was using and this bumps the verbosity slightly (2->3) to reduce noise at 2.

Kubernetes-commit: 804ec9457a78f03bbb2c78da94ea163dbff9329f
2017-08-02 20:58:39 -07:00
deads2k 0ee5e1006e remove dead log handler and increase verbosity
Kubernetes-commit: 9e263af7dacafe590cc585f0c37123310a2a9a4f
2017-08-29 13:13:06 +00:00
Kubernetes Publisher e057ae1d55 Merge pull request #49656 from deads2k/server-36-admit-error
Automatic merge from submit-queue (batch tested with PRs 49237, 49656, 49980, 49841, 49899)

make admission tolerate object without objectmeta for errors

Not all object have ObjectMeta (see SARs for instance).  Admission should tolerate this condition without giving meaningless errors.

@derekwaynecarr ptal
@php-coder fyi

Kubernetes-commit: 093883433bb2199654b6341f47e10e7166d22214
2017-08-02 19:11:11 -07:00
deads2k f3aa141adb make admission tolerate object without objectmeta for errors
Kubernetes-commit: 62272a221c5c77cbc2c3e7d0dd56f0064ac2d00c
2017-08-29 13:13:06 +00:00
Kubernetes Publisher 719e9e372f Merge pull request #49412 from bjhaid/etcd_healthz_endpoint
Automatic merge from submit-queue (batch tested with PRs 49989, 49806, 49649, 49412, 49512)

This adds an etcd health check endpoint to kube-apiserver

addressing https://github.com/kubernetes/kubernetes/issues/48215.

**What this PR does / why we need it**:
This ensures kube-apiserver `/healthz` endpoint fails whenever connectivity cannot be established to etcd, also ensures the etcd preflight checks works with unix sockets

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

**Special notes for your reviewer**:
This PR does not use the etcd client directly as the client object is wrapped behind the storage interface and not exposed directly for use, so I decided to reuse what's being done in the preflight. So this will only check fail for connectivity and not etcd auth related problems. I did not write tests for the endpoint because I couldn't find examples that I could follow for writing tests for healthz related endpoints, I'll be willing to write those tests if someone can point me at a relevant one.

**Release note**:
```release-note
Add etcd connectivity endpoint to healthz
```

@deads2k please help review, thanks!

Kubernetes-commit: 22af024093efc75dc2d9f732dbb3f41db945b575
2017-08-02 17:06:02 -07:00
bjhaid 7dfcb9c56f This adds an etcd health check endpoint to kube-apiserver
addressing https://github.com/kubernetes/kubernetes/issues/48215.

Kubernetes-commit: 47d748c5dc989ea46142569bf42636c622fe128a
2017-08-29 13:13:05 +00:00
Kubernetes Publisher c377b37cda Merge pull request #50013 from deads2k/tpr-20-remove-bad-discovery
Automatic merge from submit-queue

cleanup dead installer code

cleans up some installer code that was dead and reorders a little of the flow to reduce complexity.

@kubernetes/sig-api-machinery-misc

Kubernetes-commit: e3c24829591b7a2097fc9cd85f9d109b5d9ca416
2017-08-02 13:35:35 -07:00
Kubernetes Publisher a1940c88e1 Merge pull request #49782 from supereagle/update-generated-deepcopy
Automatic merge from submit-queue (batch tested with PRs 50029, 48517, 49739, 49866, 49782)

Update generated deepcopy code

**What this PR does / why we need it**:
In generated deepcopy code, the method names in comments do not match the real method names.

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

**Special notes for your reviewer**:
/assign @sttts @caesarxuchao

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

Kubernetes-commit: 84e0326eb1f108f0d7aa2e9e48fb0c4a8edb4bd5
2017-08-29 13:13:05 +00:00
deads2k be2b87fdb8 cleanup dead installer code
Kubernetes-commit: c2874941620c264813b6bfa42913f95fd0cc2317
2017-08-29 13:13:05 +00:00
Kubernetes Publisher 713755562e Merge pull request #48861 from mbohlool/openapi_aggr
Automatic merge from submit-queue (batch tested with PRs 49992, 48861, 49267, 49356, 49886)

Reintegrate aggregation support for OpenAPI

Reintegrating changes of #46734

Changes summary:

- Extracted all OpenAPI specs to new repo `kube-openapi`
- Make OpenAPI spec aggregator to copy and rename any non-requal model (even with documentation change only).
- Load specs when adding APIServices and retry on failure until successful spec retrieval or a 404.
- Assumes all Specs except aggregator's Spec are static
- A re-register of any APIService will result in updating the spec for that service (Suggestion for TPR: they should be registered to aggregator API Server, Open for discussion if any more changes needed for another PR.)

fixes #48548

Kubernetes-commit: 9067d359511890b893794c2e0a93bff88ed7d697
2017-08-29 13:13:04 +00:00
supereagle 2faadf8c85 update generated deepcopy code
Kubernetes-commit: a1c880ece3574a2c7170e0d040489d56dd912e08
2017-08-29 13:13:04 +00:00
mbohlool f26c819f3d Update Bazel
Kubernetes-commit: 1806609596aa05f3ee2d941fd26978451b946383
2017-08-29 13:13:04 +00:00
mbohlool e671fe20d7 Update main repo references to new kube-openapi repo
Kubernetes-commit: 400b77b48f972b1e10854980586559d5852088c7
2017-08-29 13:13:04 +00:00