Commit Graph

4396 Commits (f189015c0325a4742a9a908b871c03ab60cfdc6b)

Author SHA1 Message Date
Kubernetes Submit Queue 819604e2ed
Merge pull request #65558 from apelisse/dry-run-feature-gate
Automatic merge from submit-queue (batch tested with PRs 66410, 66398, 66061, 66397, 65558). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

dry-run: Create feature-gate flag

Creates a feature gate flag for dry-run. Currently, dry-run query parameter is completely blocking all requests, once the feature is implemented, the flag will allow the parameter to pass if enabled.

cc @jennybuckley @deads2k @liggitt @lavalamp 

**Release note**:

```release-note
NONE
```
2018-07-20 18:51:14 -07:00
Kubernetes Submit Queue b914542b9c
Merge pull request #66264 from joejulian/workaround_for_slow_arm64_math
Automatic merge from submit-queue (batch tested with PRs 66341, 66405, 66403, 66264, 66447). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

extend timeout to workaround slow arm64 math

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

The math/big functions are slow on arm64. There is improvement coming
with go1.11 but until such time as that version can be used to build releases, 
if a server uses rsa certificates on arm64, the math load for the multitude
of watches over-taxes the ability of the processor and the TLS connections
time out. Retries will also not succeed and serve to exacerbate the problem.

By extending the timeout, the TLS connections will eventually be
successful and the load will drop.

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

**Special notes for your reviewer**:
This was tested on a Raspberry Pi 3

**Release note**:
```release-note
Extend TLS timeouts to work around slow arm64 math/big
```
2018-07-20 16:02:14 -07:00
Kubernetes Submit Queue 267dd6b6a2
Merge pull request #66403 from deads2k/api-03-panic-track
Automatic merge from submit-queue (batch tested with PRs 66341, 66405, 66403, 66264, 66447). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

indicate which scheme has conflicting data

An oversight when adding scheme origination to error messages.  There are a couple state dependent panics which are useful to gain info on.

@sttts 
@kubernetes/sig-api-machinery-misc 

```release-note
NONE
```
2018-07-20 16:02:11 -07:00
Kubernetes Submit Queue 6c500be080
Merge pull request #66218 from atlassian/handle-errors
Automatic merge from submit-queue (batch tested with PRs 66152, 66406, 66218, 66278, 65660). If you want to cherry-pick this 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 errors

**What this PR does / why we need it**:
This is a followup PR for https://github.com/kubernetes/kubernetes/pull/64664 to handle errors returned from `.AddToScheme()` in places where they are not handled.

**Release note**:
```release-note
NONE
```
/kind cleanup
/sig api-machinery
/cc @sttts
2018-07-20 12:12:15 -07:00
Antoine Pelisse 9e7b140450 dry-run: Create feature-gate flag 2018-07-20 11:40:06 -07:00
Jordan Liggitt aad0e2e15f
Do not attempt to convert nil object during DELETE webhook admission 2018-07-20 08:31:07 -04:00
Kubernetes Submit Queue 24fc97a828
Merge pull request #66249 from deads2k/cli-03-restmapper
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>.

fill in normal restmapping info with the legacy guess

@DirectXMan12 noted this here: https://github.com/kubernetes/kubernetes/issues/65718#issuecomment-401915805

The code does look wrong. This tries to fix it up

@kubernetes/sig-api-machinery-bugs 

```release-note
NONE
```
2018-07-19 14:38:58 -07:00
David Eads 7276aa0c7a indicate which scheme has conflicting data 2018-07-19 16:48:44 -04:00
Joe Julian 62b9d37866 extend timeout to workaround slow arm64 math
The math/big functions are slow on arm64. There is improvement coming
with go1.11 but in the mean time if a server uses rsa certificates on
arm64, the math load for the multitude of watches over taxes the ability
of the processor and the TLS connections time out. Retries will also not
succeed and serve to exacerbate the problem.

By extending the timeout, the TLS connections will eventually be
successful and the load will drop.

Fixes #64649
2018-07-19 10:52:46 -07:00
Kubernetes Submit Queue 8770d12494
Merge pull request #65572 from yue9944882/fixes-admission-operation-mismatch-for-create-on-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>.

fixes operation for "create on update"

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

Set operation to `admission.Create` for create-on-update requests.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Checks CREATE admission for create-on-update requests instead of UPDATE admission
```
2018-07-19 10:42:54 -07:00
Kubernetes Submit Queue d08e68e759
Merge pull request #65849 from CaoShuFeng/debuggingRoundTripper
Automatic merge from submit-queue (batch tested with PRs 65771, 65849). If you want to cherry-pick this 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 kube-aggregator dailer

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


**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-07-19 09:29:04 -07:00
Kubernetes Submit Queue d2cc34fb07
Merge pull request #65771 from smarterclayton/untyped
Automatic merge from submit-queue (batch tested with PRs 65771, 65849). If you want to cherry-pick this 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 new conversion path to replace GenericConversionFunc

reflect.Call is very expensive. We currently use a switch block as part of AddGenericConversionFunc to avoid the bulk of top level a->b conversion for our primary types which is hand-written. Instead of having these be handwritten, we should generate them.

The pattern for generating them looks like:

```
scheme.AddConversionFunc(&v1.Type{}, &internal.Type{}, func(a, b interface{}, scope conversion.Scope) error {
  return Convert_v1_Type_to_internal_Type(a.(*v1.Type), b.(*internal.Type), scope)
})
```

which matches AddDefaultObjectFunc (which proved out the approach last year). The
conversion machinery should then do a simple map lookup based on the incoming types and invoke the function.  Like defaulting, it's up to the caller to match the types to arguments, which we do by generating this code.  This bypasses reflect.Call and in the future allows Golang mid-stack inlining to optimize this code.

As part of this change I strengthened registration of custom functions to be generated instead of hand registered, and also strengthened error checking of the generator when it sees a manual conversion to error out.  Since custom functions are automatically used by the generator, we don't really have a case for not registering the functions.

Once this is fully tested out, we can remove the reflection based path and the old registration methods, and all conversion will work from point to point methods (whether generated or custom).

Much of the need for the reflection path has been removed by changes to generation (to omit fields) and changes to Go (to make assigning equivalent structs easy).

```release-note
NONE
```
2018-07-19 09:29:00 -07:00
Kubernetes Submit Queue 7f912af75c
Merge pull request #59383 from tanshanshan/fix-little3
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Replace info log with warn log

**What this PR does / why we need it**:
Replace info log with warn log
**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 #59356 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-19 07:28:44 -07:00
Cao Shufeng dc07d27d8b fix kube-aggregator dailer 2018-07-19 14:40:33 +08:00
Kubernetes Submit Queue 57321c31a8
Merge pull request #64690 from chenyb4/fix_typo
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 TestWantsExternalKubeClientSet describe clientset typo

Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>



**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-07-18 02:26:28 -07:00
Kubernetes Submit Queue a00e3748d4
Merge pull request #66302 from wking/apimachinery-runtime-doc-list
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>.

apimachinery/pkg/runtime/doc: Split list into paragraphs

[Godoc uses go/doc][1] to convert comments to HTML, and go/doc [has no markup for lists][2].  With the previous comment, the lack of paragraph-splitting lines between the list entries was leading to entries 0, 1, etc. being formatted as a single paragraph.  And the hanging indents for entry 3, etc. were leading to formatting within `<pre>` blocks:

```console
$ curl -s https://godoc.org/k8s.io/apimachinery/pkg/runtime | grep -B1 -A7 'Your API objects'
<p>
0. Your API objects have a common metadata struct member, TypeMeta.
1. Your code refers to an internal set of API objects.
2. In a separate package, you have an external set of API objects.
3. The external set is considered to be versioned, and no breaking
</p>
<pre>changes are ever made to it (fields may be added but not changed
or removed).
</pre>
```

```release-note
NONE
```

[1]: https://godoc.org/golang.org/x/tools/cmd/godoc
[2]: https://golang.org/pkg/go/doc/#ToHTML
2018-07-17 23:18:33 -07:00
Clayton Coleman 90b5fbe876
generated: bazel 2018-07-17 23:02:16 -04:00
Clayton Coleman ef561ba8b5
generated: Avoid use of reflect.Call in conversion code paths 2018-07-17 23:02:16 -04:00
Clayton Coleman b5a266141c
Remove generic conversion function 2018-07-17 23:02:16 -04:00
Clayton Coleman ba95744bc5
Make conversion function names match expected values 2018-07-17 23:02:16 -04:00
Clayton Coleman bd0e4edd4f
Add a new conversion path to replace GenericConversionFunc
reflect.Call is very expensive. We currently use a switch block as part
of AddGenericConversionFunc to avoid the bulk of top level a->b
conversion for our primary types. Instead of having these be
handwritten, we should generate them.

The pattern for generating them looks like:

```
scheme.AddConversionFunc(&v1.Type{}, &internal.Type{}, func(a, b interface{}, scope conversion.Scope) error {
  return Convert_v1_Type_to_internal_Type(a.(*v1.Type), b.(*internal.Type), scope)
})
```

which matches AddDefaultObjectFunc (which proved out the approach). The
conversion machinery would then do a simple map lookup and invoke the
function. This bypasses reflect.Call and in the future allows Golang
mid-stack inlining to optimize this code.

As a future step we can drop support for the reflection path and simply
return a nice error "you must write a generator for your type".
2018-07-17 23:02:15 -04:00
Clayton Coleman a36fd65c5a
conversion-gen: Report an error in conversion when names don't match 2018-07-17 23:02:09 -04:00
Clayton Coleman eb85c83e92
conversion-gen: Better error on duplicate objects 2018-07-17 23:02:02 -04:00
Clayton Coleman e9fa259451
conversion-gen: Register static untyped functions (interface{}) 2018-07-17 23:01:35 -04:00
tanshanshan 585f9c1af8 fix info level message 2018-07-18 08:46:39 +08:00
W. Trevor King 7a546ef223 apimachinery/pkg/runtime/doc: Split list into paragraphs
Godoc uses go/doc to convert comments to HTML [1], and go/doc has no
markup for lists [2].  With the previous comment, the lack of
paragraph-splitting lines between the list entries was leading to
entries 0, 1, etc. being formatted as a single paragraph.  And the
hanging indents for entry 3, etc. were leading to formatting within
<pre> blocks:

  $ curl -s https://godoc.org/k8s.io/apimachinery/pkg/runtime | grep -B1 -A7 'Your API objects'
  <p>
  0. Your API objects have a common metadata struct member, TypeMeta.
  1. Your code refers to an internal set of API objects.
  2. In a separate package, you have an external set of API objects.
  3. The external set is considered to be versioned, and no breaking
  </p>
  <pre>changes are ever made to it (fields may be added but not changed
  or removed).
  </pre>

[1]: https://godoc.org/golang.org/x/tools/cmd/godoc
[2]: https://golang.org/pkg/go/doc/#ToHTML
2018-07-17 11:08:55 -07:00
Kubernetes Submit Queue da1bb02830
Merge pull request #66078 from deads2k/client-01-list
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 fake dynamic client listing bug

The fake dynamic client used for unit testing had a bug that prevented list from working.  Added a test and fixed the fake client.

@kubernetes/sig-api-machinery-bugs 
/assign @tnozicka 

```release-note
NONE
```
2018-07-17 10:20:20 -07:00
Kubernetes Submit Queue a74df596ab
Merge pull request #63418 from roycaihw/openapi-delete-path
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 openapi and doc to reflect 202 path in API server delete handler

**What this PR does / why we need it**:
Our API server returns 202 Accepted if a delete operation is asynchronous, but it is not reflected in our openapi spec and documentation. This PR adds 202 path in endpoint installer and updates our openapi spec and docs. The change in openapi spec may affect some clients that depend on the error paths. [Python client](e057f27306/kubernetes/client/api_client.py (L97-L102)) only depends on response type, which is not changed in this PR. Sending this PR to see if it breaks client-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)*:
ref https://github.com/kubernetes/kubernetes/issues/33196

**Special notes for your reviewer**:

**Release note**:

```release-note
OpenAPI spec and documentation reflect 202 Accepted response path for delete request
```
2018-07-17 07:44:44 -07:00
David Eads 0aa13d7502 fill in normal restmapping info with the legacy guess 2018-07-17 09:39:44 -04:00
David Eads 60afd0ba81 fix dynamic client listing bug 2018-07-17 08:39:57 -04:00
Mikhail Mazurskiy 5cab7f9a57
Handle errors 2018-07-17 20:47:14 +10:00
Kubernetes Submit Queue 849603d5b5
Merge pull request #66263 from hzxuzhonghu/patch-misc
Automatic merge from submit-queue (batch tested with PRs 66212, 66256, 66263, 66193). If you want to cherry-pick this 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 useless codec param from strategicPatchObject

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

`codec` param is not used, and was introduced in 2016.

**Release note**:

```release-note
NONE
```
2018-07-17 03:33:13 -07:00
Kubernetes Submit Queue bfba154715
Merge pull request #66256 from sigma/patch-2
Automatic merge from submit-queue (batch tested with PRs 66212, 66256, 66263, 66193). If you want to cherry-pick this 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: fix error message spelling in rest config

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

Fixing spelling because it offends the eye.

**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-07-17 03:33:07 -07:00
xuzhonghu 43baa697aa remove useless codec param from strategicPatchObject 2018-07-17 11:33:53 +08:00
Yann Hodique f0ca5c1376
client-go: fix error message spelling in rest config 2018-07-16 16:00:03 -07:00
Yann Hodique f77060aa8d
client-go: update documentation for remotecommand.StreamOptions
The ability to explicitly define the supported protocols was removed in commit 12c7874c0d
Adjust documentation accordingly.
2018-07-16 14:43:54 -07:00
Kubernetes Submit Queue b9bd7f2ffb
Merge pull request #66210 from foxyriver/delete-unused-var
Automatic merge from submit-queue (batch tested with PRs 66158, 66041, 66210). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

splitRE is defined, but is never be referenced

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

splitRE is defined, but is never be referenced

```release-note
NONE
```
2018-07-16 09:14:10 -07:00
Kubernetes Submit Queue 43b801d499
Merge pull request #66041 from liggitt/manual-registries
Automatic merge from submit-queue (batch tested with PRs 66158, 66041, 66210). If you want to cherry-pick this 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 manually written typed registries

These were only used in a handful of places, and were not consistently available for all types.

They add a lot of call sites for PRs like https://github.com/kubernetes/kubernetes/pull/65105 and are not generally useful (very few callers have the ability to construct the underlying store).

This PR switches the scale subresources to use the underlying store directly (like the status subresources already were), and removes the manually written Registry impls.

/sig api-machinery
/kind cleanup
/assign @deads2k

/hold
will hold for https://github.com/kubernetes/kubernetes/pull/65105 and rebase after that

```release-note
NONE
```
2018-07-16 09:14:06 -07:00
Kubernetes Submit Queue 4239729fc1
Merge pull request #66028 from sttts/sttts-crd-array-columns
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-apiserver: add test for non-base type columns

Non-basic types can be converted to strings in CRD table columns. This PR adds a test.
2018-07-16 00:00:57 -07:00
Kubernetes Submit Queue 04f5200295
Merge pull request #66054 from nikhita/apiserver-readme-update-2018
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiserver/README: update to 2018 for compatibility

/shrug
/assign sttts 

**Release note**:

```release-note
NONE
```
2018-07-14 01:45:53 -07:00
foxyriver dabcec0e38 splitRE is never be referenced 2018-07-14 15:56:16 +08:00
Kubernetes Submit Queue 614e3adda0
Merge pull request #65737 from roycaihw/api-linter
Automatic merge from submit-queue (batch tested with PRs 64181, 65737). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

API linter framework and namesMatch API rule

**What this PR does / why we need it**:
Bump kube-openapi dependency to use the [API linter framework](https://github.com/kubernetes/kube-openapi/pull/83) in k/k OpenAPI spec generation procedure. 

Currently one API rule is enforced: 
"Go field names must be CamelCase. JSON field names must be camelCase. Other than capitalization of the initial letter, the two should almost always match. No underscores nor dashes in either."

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

**Special notes for your reviewer**:
Most code change in this PR was generated (~1700 lines). Please see commits for detail.

**Release note**:

```release-note
NONE
```

/sig api-machinery
/cc @pwittrock @mbohlool
2018-07-13 18:00:00 -07:00
Kubernetes Submit Queue 60ca804515
Merge pull request #65832 from sttts/sttts-apiserver-reusable-loopback-logic
Automatic merge from submit-queue (batch tested with PRs 65832, 66160, 66145). If you want to cherry-pick this 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: make loopback logic in SecureServingOptions reusable

For reuse in other components this PR separates the loopback logic from the GenericApiServer config.
2018-07-13 13:22:04 -07:00
Jordan Liggitt 652e2dc025
generated 2018-07-13 11:41:09 -04:00
Jordan Liggitt 617078d220
Remove hand-written typed registries 2018-07-13 11:40:52 -04:00
Jordan Liggitt 3cb771a866
Use storage directly for scale subresources 2018-07-13 11:40:52 -04:00
Dr. Stefan Schimanski 7090cd3c5f apiextensions-apiserver: add test for non-base type columns 2018-07-13 13:17:20 +02:00
Dr. Stefan Schimanski dc0a736d1e apiserver: make loopback logic in SecureServingOptions reusable 2018-07-13 13:04:57 +02:00
Dr. Stefan Schimanski 0dda53526a apiextensions-apiserver: use self-signed cert fixtures in testserver 2018-07-13 09:49:54 +02:00
Dr. Stefan Schimanski c1c564fd4d apiserver: add SecureServingOptions.ExternalAddress
Before this the advertised IP (which shows up in the server cert) in case of
listening to loopback was the first host interface IP. This makes self-signed
certs non-constant, such that we cannot use fixtures.
2018-07-13 09:49:54 +02:00