Commit Graph

2523 Commits (271db7d12087c2cb9ff8f322ff9440e1b9aa61e5)

Author SHA1 Message Date
Clayton Coleman ce0dc76901
Avoid intermediate List allocations as items added to the list
Pick a reasonable middle ground between allocating larger chunks of
memory (2048 * ~500b for pod slices) and having many small allocations
as the list is resized by preallocating capacity based on the expected
list size. At worst, we'll allocate a 1M slice for pods and only add
a single pod to it (if the selector is very specific).
2017-10-10 09:11:45 -04:00
Clayton Coleman 6a76931e2c
Use watch cache when rv=0 even when limit is set 2017-10-10 09:11:44 -04:00
Clayton Coleman ac8808b792
Promote continuation token schema to v1
Change the filtering logic to require a leading path and clean that
afterwards.
2017-10-10 09:11:44 -04:00
Clayton Coleman da7124e5e5
Fill partial pages on the server rather than forcing client to
The etcd3 storage now attempts to fill partial pages to prevent clients
having to make more round trips (latency from server to etcd is lower
than client to server). The server makes repeated requests to etcd of
the current page size, then uses the filter function to eliminate any
matches. After this change the apiserver will always return full pages,
but we leave the language in place that clients must tolerate it.

Reduces tail latency of large filtered lists, such as viewing pods
assigned to a node.
2017-10-10 09:11:44 -04:00
Clayton Coleman 113889e72d
Enable API chunking and promote to beta for 1.9
All list watchers default to using chunking.
2017-10-10 09:11:41 -04:00
Dr. Stefan Schimanski adc14ef935 code-generator: fix flag check in generate-internal-groups.sh 2017-10-10 14:29:48 +02:00
Cao Shufeng a00b8153ca fix generate-groups.sh
This script should run when user pass arguements like this:
generate-groups.sh  deepcopy "k8s.io/coredump-detector/" "k8s.io/coredump-detector/apis/" "coredump:v1alpha1"
2017-10-10 16:10:39 +08:00
Jordan Liggitt 2400185f45
Change --etcd-quorum-read default to true 2017-10-10 00:16:33 -04:00
p0lyn0mial fa96700b76 removes k8s.io/kubernetes/pkg/api dependency from the webhook plugin. 2017-10-09 22:25:03 +02:00
Kubernetes Submit Queue bd9788f8f8 Merge pull request #53567 from maleck13/code-gen-nil-pointer-fix
Automatic merge from submit-queue (batch tested with PRs 53567, 53197, 52944, 49593). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Address code-gen issue 7 nil pointer when incorrect pkg name

**What this PR does / why we need it**:
When using the code-gen tool, if the comments in the ```doc.go``` file has a misspelled pkg name, it ends with a nil pointer. This can be difficult to debug. This PR fixes that by logging an error and continuing. 
https://github.com/kubernetes/code-generator/issues/7

**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**:
I was not sure whether just exiting here would be correct behaviour as reading the code , I noticed in other places it continues if the pkg is nil.
Also perhaps I should use the ```glog.V(5).info```  ?

```release-note
`NONE`
```
2017-10-09 11:18:43 -07:00
Chao Xu bbac32c299 generated 2017-10-09 10:58:12 -07:00
Chao Xu 89a0511fcb move initializer to the generic apiserver
move k8s.io/kubernetes/plugin/pkg/admission/initialization to
k8s.io/apiserver/pkg/admission/plugin/initialization/initialization.go;
move k8s.io/kubernetes/pkg/kubeapiserver/admission/configuration to
k8s.io/apiserver/pkg/admission/configuration.
2017-10-09 10:57:00 -07:00
Kubernetes Submit Queue e339400f6f Merge pull request #52793 from nikhita/crd-validation-conversion-tests
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiextensions: add round trip tests for CRD schema conversion

Follow up test for https://github.com/kubernetes/kubernetes/pull/52281.

Need to update go-openapi to get this - https://github.com/go-openapi/spec/pull/31 - in.

**Special notes for your reviewer**: The tests won't pass until https://github.com/kubernetes/kubernetes/pull/52281 is merged.

**Release note**:

```release-note
NONE
```

/cc @sttts
2017-10-09 10:22:41 -07:00
craig 962cbcc83e address code-gen issue https://github.com/kubernetes/code-generator/issues/7 2017-10-09 09:41:33 +01:00
Kubernetes Submit Queue 5d8046e482 Merge pull request #53308 from LiliC/remove-func
Automatic merge from submit-queue (batch tested with PRs 50447, 53308). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiextensions/examples: remove unnecessary function

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

The `BuildConfigFromFlags` function already calls the `InClusterConfig` function.

**Special notes for your reviewer**:

If this function was added to bypass [the warning](https://github.com/kubernetes/client-go/blob/master/tools/clientcmd/client_config.go#L529), then maybe we should instead add a comment.

/cc @sttts @nikhita
2017-10-09 00:32:13 -07:00
dahefanteng c12e6dbb80 remove repeated type conversion 2017-10-09 13:07:25 +08:00
Dr. Stefan Schimanski ecb65a6a71 Update generated files 2017-10-07 11:28:47 +02:00
Kubernetes Submit Queue f321a16af4 Merge pull request #49654 from jcbsmpsn/move-certificate-manager
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>.

Move certificate manager to client.

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

**What this PR does / why we need it**:
Migrate the certificate_manager to a location where it can be shared.

```release-note
NONE
```
2017-10-06 15:00:07 -07:00
Kubernetes Submit Queue 6ac018af01 Merge pull request #53202 from sttts/sttts-unify-generator-mains
Automatic merge from submit-queue (batch tested with PRs 53434, 53202). If you want to cherry-pick this 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-generator: unify generator main funcs and prepare for launching from one binary

- remove "generated by client-gen with custom arguments" message as this does not
  make sense in the times of k8s.io/code-generator
- unify generator main funcs and explicitly call pflag.AddFlags and pflag.Parse. This
  will allow to instantiate the generators also from other places.

Requires https://github.com/kubernetes/gengo/pull/80.

Closes https://github.com/kubernetes/kubernetes/issues/53522.
2017-10-06 11:13:32 -07:00
Dr. Stefan Schimanski 509df603b1 apimachinery: mechanical removal of ObjectCopier plumbing 2017-10-06 19:21:03 +02:00
Lili Cosic 5c70f0a99c apiextensions/examples: remove unnecessary function
BuildConfigFromFlags function already calls the InClusterConfig()
function. The `--master` flag was added to clarify the log warning
message from within the `BuildConfigFromFlags` function.
2017-10-06 19:07:51 +02:00
Dr. Stefan Schimanski ed586da147 apimachinery: remove Scheme.DeepCopy 2017-10-06 14:59:17 +02:00
Dr. Stefan Schimanski 19285b7357 apimachinery: remove Scheme.Copy 2017-10-06 14:24:05 +02:00
Kubernetes Submit Queue 5cc95fbf27 Merge pull request #53417 from crassirostris/audit-defaults
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>.

Adjust defaults of audit webhook backends

This PR:

- increases the default buffer size to contain at lease on the order of magnitude audit events than it's possible to have simultaneous requests (500 AFAIR)
- increase the default batch size. From our load tests .95 size of the log entry is under 2.5KB, therefore 400 entry will sum up to ~1MB request, which sounds reasonable
- increase the initial backoff size. AFAIU, if the initial value is zero, all retries will be used in under 15 seconds (with 0.2 jitter and 1.5 factor), while the backend or a proxy can be unavailable for some reason for 30 seconds and more.
- add throttling to the batching audit webhook

A PR to make these parameters configurable will follow-up

@hzxuzhonghu implemented throttling part of this PR

```release-note
Adjust batching audit webhook default parameters: increase queue size, batch size, and initial backoff.
Add throttling to the batching audit webhook. Default rate limit is 10 QPS.
```

/cc @sttts @tallclair @CaoShuFeng @ericchiang @piosz
2017-10-06 05:03:32 -07:00
Dr. Stefan Schimanski 60a0eb260c Update generated files 2017-10-06 12:36:51 +02:00
Dr. Stefan Schimanski a65232008d client-gen: stratify main.go
Remove double flag parsing and prepare for being instantiated inside a multi-generator process.
2017-10-06 10:48:05 +02:00
Dr. Stefan Schimanski c1062de2ff code-generator: unify generator main.go files 2017-10-06 10:48:05 +02:00
Janet Kuo ad9f9c277f Remove deprecated const from apps/v1beta2 and apps/v1 2017-10-05 15:01:52 -07:00
Janet Kuo fd48a4a895 Autogen 2017-10-05 15:01:52 -07:00
Mik Vyatskov 6bce120a11 Add throttling to the batching audit webhook
Signed-off-by: Mik Vyatskov <vmik@google.com>
2017-10-05 23:19:45 +02:00
Mik Vyatskov 5f4ff9f283 Adjust defaults of audit webhook backends
Signed-off-by: Mik Vyatskov <vmik@google.com>
2017-10-05 23:18:55 +02:00
Jacob Simpson 415c4d2c3a Move certificate manager to client. 2017-10-05 12:54:38 -07:00
Janet Kuo 9813a5278f Add API version apps/v1
Add a new API version apps/v1.
apps/v1 has a copy of apps/v1beta2.DaemonSet API.
2017-10-05 10:43:11 -07:00
Kubernetes Submit Queue b0eb7d884d Merge pull request #53443 from liggitt/psp-allow-escalation
Automatic merge from submit-queue (batch tested with PRs 53454, 53446, 52935, 53443, 52917). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use pointer for PSP allow escalation

Fixes #53437 

The `AllowPrivilegeEscalation` field was added to PodSpec and PodSecurityPolicySpec in 1.8.0.

In order to remain compatible with pre-1.8.0 behavior, PodSecurityPolicy objects created against a previous release must not restrict this field, which means the field must default to true in PodSecurityPolicySpec. However, the field was added as a `bool`, not a `*bool`, which means that no defaulting is possible.

We have two options:
1. Require all pre-existing PodSecurityPolicy objects that intend to allow privileged permissions to update to set this new field to true
2. Change the field to a `*bool` and default it to true.

This PR does the latter. With this change, we have the following behavior:

A 1.8.1+ client/server now has three ways to serialize:
* `nil` values are dropped from serialization (because `omitempty`), which is interpreted correctly by other 1.8.1+ clients/servers, and is interpreted as false by 1.8.0
* `false` values are serialized and interpreted correctly by all clients/servers
* `true` values are serialized and interpreted correctly by all clients/servers

A 1.8.0 client/server has two ways to serialize:
* `false` values are dropped from serialization (because `omitempty`), which is interpreted as `false` by other 1.8.0 clients/servers, but as `nil` (and therefore defaulting to true) by 1.8.1+ clients/servers
* `true` values are serialized and interpreted correctly by all clients/servers

The primary concern is the 1.8.0 server dropping the `false` value from serialization, but I consider the compatibility break with pre-1.8 behavior to be more severe, especially if we can resolve the regression in an immediate point release.

```release-note
PodSecurityPolicy: Fixes a compatibility issue that caused policies that previously allowed privileged pods to start forbidding them, due to an incorrect default value for `allowPrivilegeEscalation`. PodSecurityPolicy objects defined using a 1.8.0 client or server that intended to set `allowPrivilegeEscalation` to `false` must be reapplied after upgrading to 1.8.1.
```
2017-10-05 05:06:30 -07:00
Kubernetes Submit Queue e9a0b157d5 Merge pull request #53345 from ncdc/crd-add-fieldSelector-support
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Support field selectors for CRDs

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>



**What this PR does / why we need it**: allow field selectors to be used with custom resources

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Custom resources served through CustomResourceDefinition now support field selectors for `metadata.name` and `metadata.namespace`.
```
2017-10-04 11:47:43 -07:00
Jordan Liggitt bed6d0f5ea
Use pointer for PSP allow escalation 2017-10-04 13:55:06 -04:00
Dr. Stefan Schimanski 96b596133a Update generated files 2017-10-04 16:53:13 +02:00
Dr. Stefan Schimanski abfb658d76 sample-apiserver: port to k8s.io/code-generator/generate-internal-groups.sh 2017-10-04 16:53:13 +02:00
Dr. Stefan Schimanski cba2c0967f code-generator: turn hack/update-codegen.sh into re-usable generate-{internal,}-groups.sh scripts 2017-10-04 16:53:12 +02:00
Dr. Stefan Schimanski 8a98063eab code-generator: rename _test to _examples 2017-10-04 16:53:12 +02:00
Kubernetes Submit Queue 8e30314c95 Merge pull request #53394 from p0lyn0mial/cleanup_kubeapi_admission_initializer
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>.

removes Authorizer and ExternalClientSet from kubeapiserver's admissi…

**What this PR does / why we need it**:
removes Authorizer and ExternalClientSet from kubeapiserver's admission initializer.


**Release note**:

```
NONE
```
2017-10-04 07:50:35 -07:00
Andy Goldstein 74b4db2489 Update bazel
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-04 09:32:05 -04:00
Kubernetes Submit Queue c746bd3c8a Merge pull request #53355 from mikedanese/satnam
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>.

stop assigning satnam reviews

we should automate this.
2017-10-03 23:05:52 -07:00
Kubernetes Submit Queue 029ed12b33 Merge pull request #49205 from dixudx/fix_api_type_typos
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix some typos in api/types

**What this PR does / why we need it**:
Fix some typos in api/types

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

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2017-10-03 20:17:43 -07:00
Ryan Roden-Corrent 53939c4433 Improve explanation of ReplicaSet.
"ReplicaSet represents the configuration of a ReplicaSet" does not tell
you much. I took the explanation from
https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#when-to-use-a-replicaset
2017-10-03 16:22:12 -04:00
Kubernetes Submit Queue 413cf643f9 Merge pull request #52512 from apelisse/truncate-body
Automatic merge from submit-queue (batch tested with PRs 53135, 52512, 48339). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

client-go: Truncate printed body based on Verbosity level

**What this PR does / why we need it**: If log verbosity is above 8, it will print the full request and response body. These might be very big (especially when downloading the openapi), and it takes multiple seconds just to print it ... Truncates the printing of that body if the level is less than 10.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-10-03 13:08:15 -07:00
Andy Goldstein 2ff87307c2 Support field selectors for CRDs
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2017-10-03 15:22:10 -04:00
p0lyn0mial 6b1f1d1414 removes Authorizer and ExternalClientSet from kubeapiserver's admission initializer. 2017-10-03 18:08:30 +02:00
Kubernetes Submit Queue 9dd4cf7964 Merge pull request #52860 from liggitt/feature-gate-lock
Automatic merge from submit-queue (batch tested with PRs 51765, 53053, 52771, 52860, 53284). If you want to cherry-pick this 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 feature gate enablement checks lock-free

Since we almost never write to this object after initial creation (basically, just in tests or during API server startup), this is a good candidate for the ["read mostly"](https://golang.org/pkg/sync/atomic/#example_Value_readMostly) pattern which leaves the reads lock-free
2017-10-03 09:02:39 -07:00
Kubernetes Submit Queue 5dfea9e609 Merge pull request #51765 from mitake/etcd3-compaction
Automatic merge from submit-queue (batch tested with PRs 51765, 53053, 52771, 52860, 53284). If you want to cherry-pick this 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 an option for turning on/off compaction from apiserver in etcd3 mode

…erver

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

This commit adds an option for controlling request of compaction to
etcd3 from apiserver. There is a situation that apiserver cannot fully
own its etcd cluster (e.g. sharing it with canal). In such a case,
apiserver should have limited access in terms of etcd's auth
functionality so it don't have a privilege to issue compaction
requests. It means that the compaction requests should be issued by
other component and apiserver's compaction requests are needless.

For such use cases, this commit adds a new flag
storagebackend.Config.DoCompaction. If the flag is true (default),
apiserver issues the compaction requests like current behaviour. If it
is false, apiserver doesn't issue the requests.

**Related issue (etcd)**
https://github.com/coreos/etcd/issues/8458
/cc @xiang90 @struz

**Release note:**
```release-note
Add --etcd-compaction-interval to apiserver for controlling request of compaction to etcd3 from apiserver.
```
2017-10-03 09:02:30 -07:00
Kubernetes Submit Queue 028ee090f6 Merge pull request #49393 from hongchaodeng/etcd_update
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>.

etcd: update version to 3.1.10

ref: https://github.com/kubernetes/kubernetes/issues/49386

Need image pushed:
```
gcr.io/google_containers/etcd:3.1.10
```
2017-10-02 23:29:51 -07:00
Mike Danese 9de1d1f577 stop assigning satnam reviews 2017-10-02 18:12:15 -07:00
Kubernetes Submit Queue e7518d8aa3 Merge pull request #50555 from atlassian/fix-error-handling-from-index-funcs
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>.

threadSafeMap: panic if index function call fails

**Which issue this PR fixes**
Fixes #43605

**Release note**:
```release-note
NONE
```
/kind bug
/sig api-machinery
2017-10-02 14:17:12 -07:00
Hongchao Deng 39e5a56691 etcd: update version to 3.1.10 2017-10-02 12:27:46 -07:00
p0lyn0mial 475493ced6 moved admission interfaces WantsClientCert, WantsAuthorizer and WantsExternalKubeClientSet to apiserver 2017-10-01 15:03:08 +02:00
Kubernetes Submit Queue bb035a2854 Merge pull request #49705 from atlassian/rbuf
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>.

Ring buffer for shared informer notifications

**What this PR does / why we need it**:
Improves memory allocation for shared informer listeners. Instead of always appending to the slice use as a ring buffer, avoiding reslice operations as long as there is room in the slice. See https://github.com/kubernetes/kubernetes/pull/47045#issuecomment-317621259 for details. This is a follow up PR for #47045.

Results from BenchmarkListener:
```
Current code (from the #47045):
1000000	      1540 ns/op	     109 B/op	       1 allocs/op
```
```
New code:
1000000	      1162 ns/op	      16 B/op	       1 allocs/op
```

**Special notes for your reviewer**:
Only review the last commit, this branch is based on #47045 PR. I'll rebase onto master once it is merged.

**Release note**:

```release-note
NONE
```
/kind enhancement
/sig api-machinery
/cc @deads2k @ncdc
2017-09-29 22:10:55 -07:00
Mikhail Mazurskiy 65369a68a1
Panic on failure to calculate index key 2017-09-30 14:52:15 +10:00
Kubernetes Submit Queue 030e23306f Merge pull request #53187 from CaoShuFeng/sample-apiserver-example
Automatic merge from submit-queue (batch tested with PRs 53263, 52967, 53262, 52654, 53187). If you want to cherry-pick this 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 sample-apiserver artifacts

The example yaml file for sample-apiserver has some errors. Fix them.

**Release note**:
```
NONE
```
2017-09-29 13:37:34 -07:00
hzxuzhonghu 81d87466c8 rename test file name 2017-09-29 14:51:55 +08:00
hzxuzhonghu b8100ceec3 remove unused filed 2017-09-29 14:44:13 +08:00
Kubernetes Submit Queue f16ed167f7 Merge pull request #53019 from smarterclayton/register
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>.

Endpoints can add a get or connect options type in their group

optionsExternalVersion is being used for shared types (meta.k8s.io). The
installer should first look in the current API group for GET and CONNECT
options objects before checking in `v1`.

OpenShift hit this while registering a new connect handler endpoint in an api group for an api that is aggregated. OpenShift should not be registering its API types into the core API group.
2017-09-28 19:08:22 -07:00
Kubernetes Submit Queue ba4f5ced3c Merge pull request #53108 from brendandburns/created
Automatic merge from submit-queue (batch tested with PRs 50280, 52529, 53093, 53108, 53168). If you want to cherry-pick this 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 201/Status to the list of returned objects.

**What this PR does / why we need it**:
Adds 201/202 to the list of codes/objects returned by `POST` and 201 to the list of codes returned by `PUT` requests in Swagger/OpenAPI

**Special notes for your reviewer**:
This helps fix 
https://github.com/kubernetes-client/csharp/issues/29

**Release note**:
```release-note
Adds 201/202 to the list of codes/objects returned by `POST` and 201 to the list of codes returned by `PUT` requests in Swagger/OpenAPI
```
2017-09-28 14:59:27 -07:00
Kubernetes Submit Queue f369c1af59 Merge pull request #53177 from alrs/fix-client-go-record-swallowed-errors
Automatic merge from submit-queue (batch tested with PRs 49249, 53203, 53209, 53208, 53177). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

vendor/k8s.io/client-go/tools/record: Fix two swallowed errors in tests

**What this PR does / why we need it**: Fixes two dropped errors in client-go.

```release-note NONE
```
2017-09-28 14:02:23 -07:00
Brendan Burns 449082f55d Add 201/202 to the list of returned codes. 2017-09-28 12:25:39 -07:00
Kubernetes Submit Queue 208ae55f6d Merge pull request #51289 from p0lyn0mial/admission_options_default_plugins
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>.

exposes a method on AdmissionOptions

**What this PR does / why we need it**:
exposes a method on AdmissionOptions that will set default admission plugin names when none were provided from the command line.

**Release note**:

```
NONE
```
2017-09-28 06:13:12 -07:00
Cao Shufeng 42b443c51a fix sample-apiserver artifacts 2017-09-28 16:47:22 +08:00
Lars Lehtonen b64a0a8f5a
vendor/k8s.io/client-go/tools/record: Fix two swallowed errors in tests 2017-09-27 19:43:11 -07:00
Kubernetes Submit Queue e33dd983ed Merge pull request #52948 from smarterclayton/new_negotiate
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add a negotiate method media type for use in explicit contexts

There are more cases now where we want to negotiate from contexts where we have a media type but no request.
2017-09-27 10:51:44 -07:00
Kubernetes Submit Queue 5952e932e9 Merge pull request #53090 from shyamjvs/fix-traces
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>.

Modify traces in deletion handler

Ref https://github.com/kubernetes/kubernetes/issues/51899#issuecomment-332356230

cc @kubernetes/sig-release-members @jdumars @dims Can we get this into 1.8?
2017-09-27 10:02:09 -07:00
Kubernetes Submit Queue 1ccdc5cdc4 Merge pull request #43346 from atlassian/fix-time-npe
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 pointer receiver handling in queryparams marshaler

**What this PR does / why we need it**:
`Time.MarshalQueryParameter()` and `Time.MarshalJSON()` try to handle nil pointer object (they call `t.IsZero()` which checks if t == nil) but fail because receiver is not a pointer so the dereference needed to pass it as receiver to these methods fails with npe.
In practice this happens with `Unstructured.SetDeletionTimestamp(Unstructured.GetDeletionTimestamp())`.

Here is the stacktrace of the failing test if receiver is not a pointer.
```go
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x1407969]

goroutine 22 [running]:
testing.tRunner.func1(0xc4204f0680)
	/usr/local/Cellar/go/1.8/libexec/src/testing/testing.go:622 +0x29d
panic(0x1485a80, 0x1782bc0)
	/usr/local/Cellar/go/1.8/libexec/src/runtime/panic.go:489 +0x2cf
k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured.(*Unstructured).SetDeletionTimestamp(0xc420030790, 0x0)
	/Users/ash2k/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go:387 +0x29
k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured.TestNilDeletionTimestamp(0xc4204f0680)
	/Users/ash2k/gopath/src/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured_test.go:40 +0x4c
```
2017-09-27 08:14:05 -07:00
Kubernetes Submit Queue 95328d3098 Merge pull request #53050 from CaoShuFeng/micro_sec
Automatic merge from submit-queue (batch tested with PRs 50685, 53050, 52899, 52913, 53067). If you want to cherry-pick this 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 fuzz of micro time

**Release note**:
```
NONE
```
/assign @sttts
2017-09-27 07:33:30 -07:00
Kubernetes Submit Queue ec657e4ebd Merge pull request #52660 from kad/npapi
Automatic merge from submit-queue (batch tested with PRs 50988, 50509, 52660, 52663, 52250). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

To be consistent with http package, check also no_proxy

**What this PR does / why we need it**:
Default http.ProxyFromEnvironment uses uppper case proxy
environment variables first, and if they are not defined,
tries lower case. For NewProxierWithNoProxyCIDR we should
provide similar user experience.
Example: cluster will not be able to access service or pod CIDRs in case user uses lower case version of proxy variables.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-09-27 05:32:25 -07:00
Shyam Jeedigunta c4ca2c7349 Modify traces in deletion handler 2017-09-27 00:48:06 +02:00
Kubernetes Submit Queue 30f015a6fc Merge pull request #52302 from smarterclayton/simplify_metrics_registration
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 all metrics handlers into common code

Remove the MonitorRequest method and replace with a method that takes
request.RequestInfo, which is our default way to talk about API objects.
Preserves existing semantics for calls.

Not for 1.8, but fixes the ugliness and code duplication in #52237
2017-09-26 13:17:38 -07:00
Kubernetes Submit Queue c7c327752f Merge pull request #53030 from cheftako/e2e-aggr
Automatic merge from submit-queue (batch tested with PRs 51648, 53030, 53009). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Fixed intermitant e2e aggregator test on GKE.

**What this PR does / why we need it**: Issue was caused by another test cleaning up its namespace.
This caused the namespace controller to try to clean up that namespace.
This involves deleting all flunders under that namespace.
However the sample-apiserver was not honoring the namespace filter.
So the flunders for the test would randomly disappear.

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

**Special notes for your reviewer**: Requires we fix the container image to contain this fix to work.

**Release note**:
```release-note NONE
```
2017-09-26 12:32:10 -07:00
Mikhail Mazurskiy 1940f5a5d2
Ring buffer for notifications
Results from BenchmarkListener:
Current code:
1000000	      1540 ns/op	     109 B/op	       1 allocs/op

New:
1000000	      1139 ns/op	      16 B/op	       1 allocs/op
2017-09-26 21:58:48 +10:00
Cao Shufeng 151c8af8fd fix fuzz of micro time 2017-09-26 19:06:46 +08:00
Di Xu 05c4640799 auto-gen 2017-09-26 13:07:36 +08:00
Di Xu a1cee9ab3b fix some typos in api types 2017-09-26 10:56:44 +08:00
Walter Fender a615ac65d8 Fixed intermittant e2e aggregator test on GKE.
Fixes issues/50945.
Issue was caused by another test cleaning up its namespace.
This caused the namespace controller to try to clean up that namespace.
This involves deleting all flunders under that namespace.
However the sample-apiserver was not honoring the namespace filter.
So the flunders for the test would randomly disappear.

Fixed image path to pick up newly built fixes from this PR.
2017-09-25 18:17:22 -07:00
Kubernetes Submit Queue 08a465bd7d Merge pull request #53001 from ericchiang/oidc-refresh-token-error-message
Automatic merge from submit-queue (batch tested with PRs 51759, 53001, 52806). If you want to cherry-pick this 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 client auth: better error when refresh response is missing id_token

/kind cleanup
@kubernetes/sig-auth-pr-reviews 

Updates https://github.com/kubernetes/kubernetes/issues/36847

```release-notes
NONE
```
2017-09-25 15:50:52 -07:00
Kubernetes Submit Queue c3b443b41c Merge pull request #51759 from wackxu/addtestcase
Automatic merge from submit-queue (batch tested with PRs 51759, 53001, 52806). If you want to cherry-pick this 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 verify case in index_test.go

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

There only verify the length of the result in the index_test and we should  also verify the content of the result.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-09-25 15:50:50 -07:00
Kubernetes Submit Queue 50fa5637b6 Merge pull request #51972 from jim-minter/producedObject
Automatic merge from submit-queue (batch tested with PRs 51067, 52319, 52803, 52961, 51972). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

ProducesObject should only update the returned API object resource documentation

This should be a no-op for Kubernetes (the only rest.Storage that specifies ProducesObject() is pod logs, on GET), but will allow issues such as openshift/origin#8345 to be resolved (where generated API documentation is currently incorrect due to the asymmetry between the object kind sent and received by the API)

```release-note NONE```
2017-09-25 14:50:59 -07:00
Clayton Coleman 0e4b20fbf9
Endpoints can add a get or connect options type in their group
optionsExternalVersion is being used for shared types (meta.k8s.io). The
installer should first look in the current API group for GET and CONNECT
options objects before checking in `v1`.
2017-09-25 17:05:13 -04:00
Eric Chiang a8914b73a1 oidc client auth: better error when refresh response is missing id_token 2017-09-25 09:59:52 -07:00
Nikhita Raghunath 9968c18a6c bump(github.com/go-openapi/spec): 7abd5745472fff5eb3685386d5fb8bf38683154d 2017-09-25 19:51:56 +05:30
Nikhita Raghunath d08047c240 Add round trip tests for conversion to go-openapi types 2017-09-25 19:09:17 +05:30
FengyunPan f98326b7f9 Update gophercloud to Handle New Identity Endpoints
Currently openstack cloud provider just support keystone v2.0 and v3
The latest Identity Service is publishing an ID of v3.8, we should
update gophercloud to recognize v3.8 as a valid version id.
2017-09-24 19:49:14 +08:00
Kubernetes Submit Queue 7c9e614cbb Merge pull request #52873 from ixdy/bazel-cleanup
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>..

bazel: build/test almost everything

**What this PR does / why we need it**: Miscellaneous cleanups and bug fixes. The main motivating idea here was to make `bazel build //...` and `bazel test //...` mostly work. (There's a few reasons these still don't work, but we're a lot closer.)

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/assign @BenTheElder @mikedanese @spxtr
2017-09-24 00:04:36 -07:00
Kubernetes Submit Queue e371f8ab1d Merge pull request #52443 from spxtr/racercar
Automatic merge from submit-queue (batch tested with PRs 52485, 52443, 52597, 52450, 51971). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Enable go race detection for bazel tests.

Testing if setting `features = ["-race"]` fixes the breaks in #50792.

**Release note**:
```release-note
NONE
```
2017-09-23 18:48:52 -07:00
Kubernetes Submit Queue e0f75338b5 Merge pull request #52933 from liggitt/proxy-subpath-slash
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>..

Preserve leading and trailing slashes on proxy subpaths

subresource parsing was not populating path parameters correctly (leading and trailing slashes were being stripped)

this caused bad locations to be sent to the proxy, causing https://github.com/kubernetes/kubernetes/issues/52022. the first attempt to fix that (#52065) unconditionally prefixed '/', which broke the redirect case (#52813 #52729)

fixes #52813, fixes #52729

needs to be picked to 1.7 and 1.8

```release-note
Restores redirect behavior for proxy subresources
```
2017-09-23 12:34:41 -07:00
Clayton Coleman 26d87e49cb
Add a negotiate method media type for use in explicit contexts 2017-09-23 15:08:20 -04:00
Kubernetes Submit Queue d2cf4d01c6 Merge pull request #52182 from cheftako/flags
Automatic merge from submit-queue (batch tested with PRs 51438, 52182, 51607, 47912, 51595). If you want to cherry-pick this 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 we log the flag apiserver starts with.

Trying to make sure we always log the flags an instance of apiserver
starts with.
This can be especially valuable for emailed logs or e2e/kubemark tests.

**What this PR does / why we need it**: Ensures we log the flags an apiserver was started with.

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

**Special notes for your reviewer**:

**Release note**:```release-note NONE
```
2017-09-23 08:09:46 -07:00
Kubernetes Submit Queue 8fe960e710 Merge pull request #51526 from atlassian/optimize-unstructured-converter
Automatic merge from submit-queue (batch tested with PRs 50392, 52108, 52083, 52134, 51526). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Do deep copy instead of to and from JSON encoding

**What this PR does / why we need it**:
Unstructured converter encodes to JSON and then parses the result into a new object. For `Unstructured` this can be avoided by directly doing a deep copy. It is an optimization.

**Special notes for your reviewer**:
#47889 is somewhat related.

**Release note**:
```release-note
NONE
```
/sig api-machinery
2017-09-23 07:14:08 -07:00
Kubernetes Submit Queue a3cc5dc384 Merge pull request #51542 from sttts/sttts-deepcopy-client-go
Automatic merge from submit-queue (batch tested with PRs 51929, 52015, 51906, 52069, 51542). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

client-go: simplify deepcopy calls
2017-09-23 06:16:17 -07:00
Kubernetes Submit Queue 7240b1e2ee Merge pull request #52069 from shiywang/cleanup-api
Automatic merge from submit-queue (batch tested with PRs 51929, 52015, 51906, 52069, 51542). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

move specialDefaultResourcePrefixes out of vendor/k8s.io/apiserver

just a clean-up, fixes TODO: move out of this package, it is not generic
@sttts PTAL
/assign @sttts
2017-09-23 06:16:15 -07:00
Kubernetes Submit Queue 3484ae9e49 Merge pull request #51888 from tengqm/fix-api-server-help
Automatic merge from submit-queue (batch tested with PRs 51031, 51705, 51888, 51727, 51684). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Avoid hard-coding location for auto-generated cert files

**What this PR does / why we need it**:
This fixes the confusing/incorrect help message for "--tls-cert-file" in apiserver package.

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

**Special notes for your reviewer**:
Please advise if a release note is needed.

**Release note**:
```release-note
NONE
```
2017-09-23 01:47:04 -07:00
Kubernetes Submit Queue 1c0f22ea01 Merge pull request #43016 from liggitt/time-added-pointer
Automatic merge from submit-queue (batch tested with PRs 43016, 50503, 51281, 51518, 51582). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Omit timeAdded from taint when empty

Fixes omitempty portion of https://github.com/kubernetes/kubernetes/issues/42394
2017-09-22 23:35:52 -07:00
Jordan Liggitt 04eede9b2a
Preserve leading and trailing slashes on proxy subpaths 2017-09-22 23:05:13 -04:00
Kubernetes Submit Queue 7760d9e240 Merge pull request #51959 from cmluciano/cml/updatenpowners
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 cmluciano to NetworkPolicy reviewers

**Release note**:
```
NONE
```
2017-09-22 18:25:28 -07:00