Commit Graph

3940 Commits (3d09101b6ff404da9530a3d3cf1383987dc20482)

Author SHA1 Message Date
Kubernetes Submit Queue 6625d353c7
Merge pull request #63105 from deads2k/api-06-mapper
Automatic merge from submit-queue (batch tested with PRs 62937, 63105, 63031, 63174). 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>.

rest mappings cannot logically be object converters

A `RESTMapping` in the general sense cannot be a `ObjectConverter` since the conversions are compiled, but the RESTMappings are discovered.   This starts isolating the bad assumptions into `kubectl` where they are used and removes the other bad `RESTMapping` use I found in the REST API installer that uses a mapping to determine scopes instead of using the metadata provided during API registration.

intersection of @kubernetes/sig-api-machinery-bugs and @kubernetes/sig-cli-maintainers 
@sttts @pwittrock @soltysh 

```release-note
NONE
```
2018-04-26 16:40:12 -07:00
Kubernetes Submit Queue a38a02792b
Merge pull request #62662 from wangzhen127/runtime-default
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>.

Change seccomp annotation from "docker/default" to "runtime/default"

**What this PR does / why we need it**:
This PR changes seccomp annotation from "docker/default" to "runtime/default", so that it is can be applied to all kinds of container runtimes. This PR is a followup of [#1963](https://github.com/kubernetes/community/pull/1963).

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-04-26 14:33:53 -07:00
Josh Horwitz 0f62a8cdda Fixes fake client generation for non-namespaced subresources 2018-04-26 14:58:45 -04:00
Kubernetes Submit Queue 6aad80cce3
Merge pull request #63146 from liggitt/remove-patch-retry
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>.

collapse patch conflict retry onto GuaranteedUpdate

xref https://github.com/kubernetes/kubernetes/issues/63104

This PR builds on https://github.com/kubernetes/kubernetes/pull/62868

1. When the incoming patch specified a resourceVersion that failed as a precondition, the patch handler would retry uselessly 5 times. This PR collapses onto GuaranteedUpdate, which immediately stops retrying in that case.

2. When the incoming patch did not specify a resourceVersion, and persisting to etcd contended with other etcd updates, the retry would try to detect patch conflicts with deltas from the first 'current object' retrieved from etcd and fail with a conflict error in that case. Given that the user did not provide any information about the starting version they expected their patch to apply to, this does not make sense, and results in arbitrary conflict errors, depending on when the patch was submitted relative to other changes made to the resource. This PR changes the patch application to be performed on the object retrieved from etcd identically on every attempt.

fixes #58017
SMP is no longer computed for CRD objects

fixes #42644
No special state is retained on the first attempt, so the patch handler correctly handles the cached storage optimistically trying with a cached object first

/assign @lavalamp

```release-note
fixed spurious "unable to find api field" errors patching custom resources
```
2018-04-26 10:55:27 -07:00
David Eads 6900f8856f rest mappings cannot logically be object converters 2018-04-26 12:47:25 -04:00
Kubernetes Submit Queue d4b678036f
Merge pull request #63200 from deads2k/api-09-duplicate
Automatic merge from submit-queue (batch tested with PRs 62911, 63200). 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>.

stop duplicating preferred version order 

`GroupMeta` includes two fields for a preferred groupVersion, `.GroupVersion` and `.GroupVersion[0]`.  This collapses onto the latter.

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

lots of ripples, but eliminate of duplication is good.
/assign @sttts 
/assign @cheftako 


```release-note
NONE
```
2018-04-26 09:43:06 -07:00
Kubernetes Submit Queue dd5f030b02
Merge pull request #63165 from deads2k/api-08-kubeapiversion
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 KUBE_API_VERSIONS

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

KUBE_API_VERSIONS is an attempt to control the available serialization of types. It pre-dates the idea that we'll have separate schemes, so it's not a thing that makes sense anymore.

Server-side we've had a very clear message about breaks in the logs for a year "KUBE_API_VERSIONS is only for testing. Things will break.".

Client-side it became progressively more broken as we moved to generic types for CRUD more than a year ago. What is registered doesn't matter when everything is unstructured.

We should remove this piece of legacy since it doesn't behave predictable server-side or client-side.

@smarterclayton @lavalamp
@kubernetes/sig-api-machinery-bugs 

```release-note
KUBE_API_VERSIONS is no longer respected.  It was used for testing, but runtime-config is the proper flag to set.
```
2018-04-26 08:22:36 -07:00
David Eads a9518acacd generated 2018-04-26 10:03:37 -04:00
David Eads a89291a5de stop duplicating preferred version order 2018-04-26 10:03:36 -04:00
Kubernetes Submit Queue b8ab2891b3
Merge pull request #63062 from hanxiaoshuai/cleanup0424
Automatic merge from submit-queue (batch tested with PRs 63009, 63062). 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>.

clean up unused code fakeRL in requestinfo_test.go

**What this PR does / why we need it**:
clean up unused code fakeRL in requestinfo_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-26 05:53:12 -07:00
Kubernetes Submit Queue b181af1c68
Merge pull request #63009 from mvladev/etcd-disable-automatic-metric-registration
Automatic merge from submit-queue (batch tested with PRs 63009, 63062). 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>.

Register Prometheus etcdmetrics only for apiserver

Removed automatic registration with `init` funciton and use `Register` function to register metrics for etcd storage only when requested.



**What this PR does / why we need it**: Prevents leaking etcd metrics to other k8s components

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-04-26 05:53:09 -07:00
David Eads a68c57155e remove KUBE_API_VERSIONS 2018-04-26 08:27:49 -04:00
Kubernetes Submit Queue 5fa25a9508
Merge pull request #63133 from hzxuzhonghu/remove-always-admit
Automatic merge from submit-queue (batch tested with PRs 63186, 63133). 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>.

eliminate alwaysAdmit admission in apiserver test

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

alwaysAdmit is of no meaning, previously if not specify an admission plugin, it will panic, but now since we add protection `if admit != nil`. So can safely remove it.

**Release note**:

```release-note
NONE
```
2018-04-26 04:50:13 -07:00
hangaoshuai ba20be9911 add checks validation MinRequestTimeout of ServerRunOptions 2018-04-26 16:02:31 +08:00
Mikhail Mazurskiy bbef0f6f9d
Remove incomplete uint64 support from JSON unmarshaling 2018-04-26 15:31:56 +10:00
Kubernetes Submit Queue cc845246e4
Merge pull request #63063 from feiskyer/azure-new-sdk
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>.

Upgrade Azure Go SDK to stable version

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

Kubernetes is using a beta version of Azure Go SDK now. If there are bugs in them, it's hard to upgrade because Azure Go SDK won't release new patches for pre-released SDK versions. We should upgrade Go SDK to stable version (e.g. v14.6.0)

Refer #62249

Refer Azure/azure-sdk-for-go#1586

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

**Special notes for your reviewer**:

This PR includes changes in #61972, but with a newer go-autorest version.

**Release note**:

```release-note
Upgrade Azure Go SDK to stable version (v14.6.0)
```
2018-04-25 22:20:50 -07:00
Kubernetes Submit Queue 9e52d14eb9
Merge pull request #62805 from awly/take-reviews
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 awly as reviewer in several subtrees

```release-note
NONE
```
2018-04-25 21:24:31 -07:00
Jordan Liggitt b526532c8a
Add tests for resourceVersion precondition failures on patch 2018-04-25 22:44:46 -04:00
Jordan Liggitt fbd6f38084
collapse patch conflict retry onto GuaranteedUpdate
builds on #62868

1. When the incoming patch specified a resourceVersion that failed as a precondition,
the patch handler would retry uselessly 5 times. This PR collapses onto GuaranteedUpdate,
which immediately stops retrying in that case.

2. When the incoming patch did not specify a resourceVersion, and persisting to etcd
contended with other etcd updates, the retry would try to detect patch conflicts with
deltas from the first 'current object' retrieved from etcd and fail with a conflict error
in that case. Given that the user did not provide any information about the starting version
they expected their patch to apply to, this does not make sense, and results in arbitrary
conflict errors, depending on when the patch was submitted relative to other changes made
to the resource. This PR changes the patch application to be performed on the object retrieved
from etcd identically on every attempt.

fixes #58017
SMP is no longer computed for CRD objects

fixes #42644
No special state is retained on the first attempt, so the patch handler correctly handles
the cached storage optimistically trying with a cached object first
2018-04-25 21:55:13 -04:00
Pengfei Ni 058b619040 Update vendors for client-go 2018-04-26 09:38:48 +08:00
Kubernetes Submit Queue 3dbcd1ddce
Merge pull request #63059 from ceshihao/upgrade_json_package_fix_base64_newline
Automatic merge from submit-queue (batch tested with PRs 59965, 59115, 63076, 63059). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Upgrade dep json-iterator/go to fix base64 decode bug

**What this PR does / why we need it**:
upgrade dep `json-iterator/go` to fix base64 decode bug #62742

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

**Special notes for your reviewer**:
Just upgrade `json-iterator/go` to latest which includes base64 decode fix https://github.com/json-iterator/go/pull/266
No other code changes

**Release note**:

```release-note
None
```
2018-04-25 17:07:18 -07:00
Clayton Coleman 847edc0e27
restclient should not depend on api/core/v1 2018-04-25 18:52:16 -04:00
Clayton Coleman aa9fd2bf11
client-go should not take a dependency on the v1 api lightly
These constants will never change, and tools/ should not be depending on
core/api/v1 (there is nothing v1 specific about them).
2018-04-25 18:52:16 -04:00
Kubernetes Submit Queue b942c53546
Merge pull request #62868 from lavalamp/refactor-patch
Automatic merge from submit-queue (batch tested with PRs 62432, 62868, 63040). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Refactor patch

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

Continue making patch handler readable.

**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-25 12:56:10 -07:00
Kubernetes Submit Queue 97287177ee
Merge pull request #63075 from deads2k/api-05-eliminate-indirection
Automatic merge from submit-queue (batch tested with PRs 62982, 63075, 63067, 62877, 63141). 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>.

eliminate indirection from type registration

Some years back there was a partial attempt to revamp api type registration, but the effort was never completed and this was before we started splitting schemes. With separate schemes, the idea of partial registration no longer makes sense.  This pull starts removing cruft from the registration process and pulls out a layer of indirection that isn't needed.

@kubernetes/sig-api-machinery-pr-reviews 
@lavalamp @cheftako @sttts @smarterclayton 

Rebase cost is fairly high, so I'd like to avoid this lingering.

/assign @sttts 
/assign @cheftako 

```release-note
NONE
```
2018-04-25 11:53:14 -07:00
ceshihao 3fde7d6844 runhack/update-staging-godeps.sh 2018-04-25 16:11:21 +00:00
Daniel Smith 349a99b80e Refactor the patch handler for readability
This is the combination of a series of changes which individually don't
make any behavioral changes. The original commits are preserved in my
own fork in the refactor-patch-complete branch, as when squashed this is
impossible to review.

This turned a big function with lots of parameters and closures into an
object with multiple functions, fewer closures and more well documented
state transitions.
2018-04-25 09:11:20 -07:00
Kubernetes Submit Queue 5d7569d664
Merge pull request #62913 from deads2k/client-04-dynamic
Automatic merge from submit-queue (batch tested with PRs 63137, 62913). 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 a simple dynamic client that is easy to use

The dynamic client has annoyed me for the last time!  The existing one takes arguments at odd levels, requires lots of information to instantiate, does some weird pool thing, and uses unusual types.  This creates an interface like this:

```go

type DynamicInterface interface {
	ClusterResource(resource schema.GroupVersionResource) DynamicResourceInterface
	NamespacedResource(resource schema.GroupVersionResource, namespace string) DynamicResourceInterface
}

type DynamicResourceInterface interface {
	Create(obj *unstructured.Unstructured) (*unstructured.Unstructured, error)
	Update(obj *unstructured.Unstructured) (*unstructured.Unstructured, error)
	UpdateStatus(obj *unstructured.Unstructured) (*unstructured.Unstructured, error)
	Delete(name string, options *metav1.DeleteOptions) error
	DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
	Get(name string, options metav1.GetOptions) (*unstructured.Unstructured, error)
	List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error)
	Watch(opts metav1.ListOptions) (watch.Interface, error)
	Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*unstructured.Unstructured, error)
}
```

You create it from just a `rest.Config`, no mapper, no path resolving func, no trying to set up codecs ahead of time, no unnecessary pool.  It just works.

I updated the namespace controller to use it and I updated the existing dynamic client to leverage it so that I get all their tests for "free".

@kubernetes/sig-api-machinery-pr-reviews 
@liggitt @smarterclayton @bparees @sttts @ironcladlou I know each of us has struggled with the dynamic client in our time.
@lavalamp @caesarxuchao This is vastly simplifying.  I'm eager to drop the old `ClientPool`.  client-go will technically have another incompatible semver this release.  I'm up for changing it in tree.


```release-note
client-go developers: the new dynamic client is easier to use and the old is deprecated, you must switch.
```
2018-04-25 08:50:09 -07:00
Kubernetes Submit Queue a53df4d905
Merge pull request #63086 from soltysh/discovery_timeout
Automatic merge from submit-queue (batch tested with PRs 63129, 63066, 60009, 63136, 63086). 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 discovery default timeout test

/assign @sttts 

**Release note**:
```release-note
NONE
```
2018-04-25 06:29:29 -07:00
David Eads e931158128 generated 2018-04-25 09:02:32 -04:00
David Eads 1a753659cf core v1 API requires autoscaling/v1 to serve the Scale endpoint 2018-04-25 09:02:31 -04:00
David Eads df50da3adc update code generator 2018-04-25 09:02:31 -04:00
David Eads e7fbbe0e3c eliminate indirection from type registration 2018-04-25 09:02:31 -04:00
David Eads 3632037e60 add easy to use dynamic client 2018-04-25 08:55:26 -04:00
xuzhonghu e1bcca681d remove useless alwaysAdmit in apiserver test 2018-04-25 16:37:08 +08:00
Martin Vladev 40cf788013 Register Prometheus etcdmetrics only for apiserver
Removed automatic registration with `init` funciton and use `Register` function
to register metrics for etcd storage only when requested.
2018-04-25 10:06:37 +03:00
hzxuzhonghu 271f942293 mark APIServiceSpec.CABundle optional 2018-04-25 11:25:28 +08:00
Kubernetes Submit Queue 9baf337cf3
Merge pull request #63084 from mikedanese/ctx
Automatic merge from submit-queue (batch tested with PRs 59220, 62927, 63084, 63090, 62284). 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 request.Context with context.Context

Followup on https://github.com/kubernetes/kubernetes/pull/62810

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

```release-note
NONE
```
2018-04-24 19:01:17 -07:00
Kubernetes Submit Queue be20a8d1d0
Merge pull request #62927 from hzxuzhonghu/fix-typo
Automatic merge from submit-queue (batch tested with PRs 59220, 62927, 63084, 63090, 62284). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix typo: mutating validating admission should be distinguished

1. fix typo: mutating validating admission should be distinguished

1. avoid calling admit.Handles twice in delete

**Release note**:

```release-note
NONE
```
2018-04-24 19:01:14 -07:00
Kubernetes Submit Queue 6fbca94fae
Merge pull request #63010 from deads2k/api-04-metadataaccessor
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 confusing flexibility for metadata interpretation

Metadata accessors are coded in.  This means that we don't need to inject flexibility, the flexibility is already present based on what your code relies up.  This removes the per-individual resource injection which simplifies all calling code.

intersection of @kubernetes/sig-api-machinery-pr-reviews @kubernetes/sig-cli-maintainers 

```release-note
NONE
```
2018-04-24 17:59:12 -07:00
Maciej Szulik af2353f8a3
Fix discovery default timeout test 2018-04-24 23:36:30 +02:00
Kubernetes Submit Queue bf1974c83f
Merge pull request #61711 from crassirostris/audit-size-limiting
Automatic merge from submit-queue (batch tested with PRs 62655, 61711, 59122, 62853, 62390). 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>.

Implemented truncating audit backend

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

Introduces an optional truncating backend, disabled by default, that estimates the size of audit events and truncates events/split batches based on the configuration.

/cc @sttts @tallclair @CaoShuFeng @ericchiang 

```release-note
Introduce truncating audit backend that can be enabled for existing backend to limit the size of individual audit events and batches of events.
```
2018-04-24 13:28:17 -07:00
Mike Danese 54fd2aaefd replace request.Context with context.Context 2018-04-24 08:59:00 -07:00
Kubernetes Submit Queue 4344d33772
Merge pull request #63014 from fisherxu/removerv
Automatic merge from submit-queue (batch tested with PRs 63046, 62925, 63014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove repeated get resourceversion in update

**What this PR does / why we need it**:
Obj have no updated, so no need to reGet.

**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-24 00:42:16 -07:00
hangaoshuai 08409554bf clean up unused code fakeRL in requestinfo_test.go 2018-04-24 14:33:47 +08:00
Kubernetes Submit Queue 8f20a815e5
Merge pull request #62002 from k82cn/k8s_61410_1
Automatic merge from submit-queue (batch tested with PRs 62495, 63003, 62829, 62151, 62002). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Added MatchFields to NodeSelectorTerm

**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)*:
part of #61410 

**Special notes for your reviewer**:
According to the discussion at #61410 , we'd like to introduce a new selector term for node's field.

**Release note**:

```release-note
Added `MatchFields` to `NodeSelectorTerm`; in 1.11, it only support `metadata.name`.
```
2018-04-23 22:45:28 -07:00
Da K. Ma b80a01b210 generated codes.
Signed-off-by: Da K. Ma <klaus1982.cn@gmail.com>
2018-04-24 08:55:04 +08:00
Da K. Ma 8bfc99475f Added MatchFields to NodeSelectorTerm.
Signed-off-by: Da K. Ma <klaus1982.cn@gmail.com>
2018-04-24 08:54:35 +08:00
Kubernetes Submit Queue a0f9412361
Merge pull request #62810 from liggitt/request-mapper
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 request context mapper

http.Request now allows setting/retrieving a per-request context, which removes the need for plumbing a request-context mapper throughout the stack

In addition to being way simpler, this has the benefit of removing a potentially contentious lock object from the handling path

This PR:
* removes RequestContextMapper
* converts context fetchers to use `req.Context()`
* converts context setters to use `req = req.WithContext(...)`
* updates filter plumbing in two places (audit and timeout) to properly return the request with modified context
* updates tests that used a fake context mapper to set the context in the request instead

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

```release-note
NONE
```
2018-04-23 13:01:14 -07:00
Kubernetes Submit Queue 939c0783e1
Merge pull request #62152 from smarterclayton/use_client_store
Automatic merge from submit-queue (batch tested with PRs 63001, 62152, 61950). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

When 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.

Example:

```
bootstrap:
  writes to certDir/kubelet-client-DATE.pem and symlinks to certDir/kubelet-client-current.pem
  writes node.kubeconfig pointing to certDir/kubelet-client-current.pem
rotation:
  writes to certDir/kubelet-client-DATE.pem and symlinks to certDir/kubelet-client-current.pem
```

This will also allow us to remove the wierd "init store with bootstrap cert" stuff, although I'd prefer to do that in a follow up.

@mikedanese @liggitt as per discussion on Slack today

```release-note
The `--bootstrap-kubeconfig` argument to Kubelet previously created the first bootstrap client credentials in the certificates directory as `kubelet-client.key` and `kubelet-client.crt`.  Subsequent certificates created by cert rotation were created in a combined PEM file that was atomically rotated as `kubelet-client-DATE.pem` in that directory, which meant clients relying on the `node.kubeconfig` generated by bootstrapping would never use a rotated cert.  The initial bootstrap certificate is now generated into the cert directory as a PEM file and symlinked to `kubelet-client-current.pem` so that the generated kubeconfig remains valid after rotation.
```
2018-04-23 12:34:14 -07:00
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