Commit Graph

1288 Commits

Author SHA1 Message Date
Pingan2017
ada81a0d75 del unused func DefaultEventFilterFunc
Kubernetes-commit: 655271f89b665d87f5de6ba292ed551999635612
2018-08-24 17:26:17 +08:00
Kubernetes Publisher
79cb21f5b3 Merge pull request #66971 from tnozicka/informer-watcher
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>.

#50102 Task 2: Add UntilWithSync

**What this PR does / why we need it**:
This is a split off from https://github.com/kubernetes/kubernetes/pull/50102 to go in smaller pieces.

Introduces UntilWithSync based on informer.

**Needs https://github.com/kubernetes/kubernetes/pull/66906 first**
/hold

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

/priority important-soon
/kind bug
(bug after the main PR which is this split from)

Kubernetes-commit: c4f355a2ad9692f5459541d4e4d94fcbc5f7d946
2018-08-23 15:28:47 +00:00
Kubernetes Publisher
3a92319114 Merge pull request #67596 from nikhita/add-apimachinery-label-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 sig/api-machinery label to apimachinery OWNERS files

Inspired by https://github.com/kubernetes/kubernetes/pull/67548. List of OWNERS files taken from https://github.com/kubernetes/community/blob/master/sig-api-machinery/README.md#subprojects.

**Release note**:

```release-note
NONE
```

Kubernetes-commit: 8f4ab6fe7635983443ebef7fde5b9c8861bef5bb
2018-08-20 23:26:47 +00:00
Nikhita Raghunath
8dd267ed24 Add sig/api-machinery label to apimachinery OWNERS files
Kubernetes-commit: 6e47ba1fded3dc9932bd62affb673d321089760f
2018-08-20 18:46:47 +05:30
Kubernetes Publisher
b53d9ecf53 Merge pull request #66023 from ibrasho/change-TRUNCATED-to-DATA+OMITTED
Automatic merge from submit-queue (batch tested with PRs 60790, 66023, 67549). 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 TRUNCATED to DATA+OMITTED in kubectl config view

**What this PR does / why we need it**:
Based on the discussion in #61573, this PR switches the replacement text for CA certificate data and client certificates and secrets printed using `kubectl config view`. Currently, `REDACTED` is used, which might give a false impression that the data is a secret (which is not true for the public certificates).

This PR changes `REDACTED` to `DATA+OMITTED`. The printed string is the base64 encoded string on the byte stream. Some trickery is involved to print a readable string (refer to [this comment](https://github.com/kubernetes/kubernetes/pull/66023/files#diff-aec000ca3f293c94dcd99b4a9d1c5c3cL86) for more info).

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

**Special notes for your reviewer**:

**Release note**:
```release-note
Switched certificate data replacement from "REDACTED" to "DATA+OMITTED"
```

Kubernetes-commit: ae9beb4663329c8ca824638805b70eba0d295977
2018-08-18 05:30:00 +00:00
Kubernetes Publisher
5d107d4ebc Merge pull request #65779 from cblecker/mergo-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>.

update github.com/imdario/mergo to v0.3.5

**What this PR does / why we need it**:
Updates github.com/imdario/mergo library to v0.3.5. We were pinned because of a functionality change in the dependency, however, a new function was introduced with similar functionality to the old.

There is apparently some Debian packaging issues (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878254) because of this. I'm still not clear what those are, unless they are forcing the library to update, as opposed to using our `vendor/`.

That said, this will allow for some of those vendor conflicts to resolve for anyone else who is using client-go, so that's at least worthwhile.

**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 #27543, fixes https://github.com/kubernetes/client-go/issues/431

**Special notes for your reviewer**:

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

Kubernetes-commit: 6b4135267911b6c10ed536308d29d2a7c453eef6
2018-08-18 01:30:48 +00:00
Kubernetes Publisher
d3f03ecc37 Merge pull request #66920 from wking/segments-segment-typo
Automatic merge from submit-queue (batch tested with PRs 66920, 67316, 67363, 67528, 66963). 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/rest: Fix "segments segment" comment typo

The typo landed with `SubResource` in adb75e1f (kubernetes/kubernetes#29147).

```release-note
NONE
```

Kubernetes-commit: 49b295415d398a3a36b5abb7ba071d3b224087eb
2018-08-17 21:32:35 +00:00
Kubernetes Publisher
b95fa2e4f3 Merge pull request #67347 from juanvallejo/jvallejo/use-temp-file-config-tests
Automatic merge from submit-queue (batch tested with PRs 67347, 67307, 67358, 67364, 67385). 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 temp file for kubeconfig in test

Followup to https://github.com/kubernetes/kubernetes/pull/67093

Updates client_config_test to use a temporary file for kubeconfig.

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

cc @deads2k @soltysh

Kubernetes-commit: 46bfa1ab17afaffc584f560ee5c752ecbbad4f61
2018-08-16 13:35:57 +00:00
Kubernetes Publisher
744b11616f Merge pull request #66906 from tnozicka/rename-until
Automatic merge from submit-queue (batch tested with PRs 67071, 66906, 66722, 67276, 67039). 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>.

#50102 Task 1: Move apimachinery/pkg/watch.Until into client-go/tools/watch.UntilWithoutRetry

**What this PR does / why we need it**:
This is a split off from https://github.com/kubernetes/kubernetes/pull/50102 to go in smaller pieces.

Moves `apimachinery/pkg/watch.Until` into `client-go/tools/watch.UntilWithoutRetry` and adds context so it is cancelable.

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

**Dev release note**:
```dev-release-note
`apimachinery/pkg/watch.Until` has been moved to `client-go/tools/watch.UntilWithoutRetry`.
While switching please consider using the new `client-go/tools/watch.UntilWithSync` or `client-go/tools/watch.Until`.
```

/cc @smarterclayton @kubernetes/sig-api-machinery-pr-reviews
/milestone v1.12
/priority important-soon
/kind bug
(bug after the main PR which is this split from)

Kubernetes-commit: b6f0aed056ab94fef0b6f54e1ca1d66a5fc228b3
2018-08-16 13:34:54 +00:00
Kubernetes Publisher
791991630f Merge pull request #67178 from cblecker/cfssl
Automatic merge from submit-queue (batch tested with PRs 66602, 67178, 67207, 67125, 66332). 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 cfssl/cfssljson utilities

**What this PR does / why we need it**:
Vendors the `cfssl` and `cfssljson` tools. Updates `kube::util::ensure-cfssl` to use them.

**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 #66995, fixes #60070

**Special notes for your reviewer**:
1. Add cfssl/cfssljson ot the required bins for saving
2. Manually cloned/checked out the new dependencies to my gopath. `godep restore` doesn't pull them down because they aren't required or already in the `Godeps.json`. Used @BenTheElder's list here: https://github.com/kubernetes/kubernetes/issues/66995#issuecomment-410594532
3. `hack/godep-save.sh` to add the packages and dependencies to godep
4. Fixed two bugs when building:
  a. `golang.org/x/crypto` needed to be updated
  b. `github.com/cloudflare/cfssl` needed to be updated to 56268a613a so we can vendor their fork of `crypto/tls`, as we discard their modified vendored stdlib.
5. Update staging godeps
6. Update the `kube::util::ensure-cfssl` to install from vendor

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

Kubernetes-commit: 818e632c1fde5fb01bc8ccf9b9ee6201f33a28b4
2018-08-16 13:34:53 +00:00
Kubernetes Publisher
961ecfb9a2 Merge pull request #67093 from juanvallejo/jvallejo/improve-config-context-update
Automatic merge from submit-queue (batch tested with PRs 67161, 67093, 67077). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

improve kubeconfig file modification time

In cases where there are few destination filenames for a given
amount of contexts, but a large amount of contexts, this patch
prevents reading and writing to the same file (or small number
of files) over and over again needlessly.

**Release note**:
```release-note
Decrease the amount of time it takes to modify kubeconfig files with large amounts of contexts
```

cc @deads2k

Kubernetes-commit: 3587aa4206ddf502540d388466985bb51fc4a0e6
2018-08-16 13:33:56 +00:00
juanvallejo
69308bcf06 use temp file for kubeconfig in test
Kubernetes-commit: 03af5089afb5d31707e7d91e55dfd6b157e6f8e1
2018-08-13 14:29:34 -04:00
Christoph Blecker
43b95360bd add more tests to clientcmd
Kubernetes-commit: e9cf2b0f798f1fac07f52b5d193419e938e3a7cd
2018-08-11 22:16:26 -07:00
Christoph Blecker
33d45c1319 Update staging godeps
Kubernetes-commit: c14a9c7c2be3f66efc62297598e4c1b98fedcb4c
2018-08-09 14:42:48 -07:00
juanvallejo
61141c1efe improve kubeconfig file modification time
Trades runtime complexity for spacial complexity when modifying
large amounts of contexts on a kubeconfig.

In cases where there are few destination filenames for a given
amount of contexts, but a large amount of contexts, this patch
prevents reading and writing to the same file (or small number
of files) over and over again needlessly.

Kubernetes-commit: d5651948cf1a14ed284b4708e2057e4cbc72bcbe
2018-08-07 15:13:57 -04:00
Kubernetes Publisher
bdfc4cfc12 Merge pull request #67024 from juanvallejo/jvallejo/add-cancel-req-discovery-rt
Automatic merge from submit-queue (batch tested with PRs 66958, 67024). 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 CancelRequest to discovery round-tripper

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

Make discovery roundtripper implement the RequestCanceler interface

cc @deads2k

Kubernetes-commit: a945b5d9281ac5cba5e4a2976a0747592c0cff87
2018-08-06 21:26:58 +00:00
juanvallejo
12e8bc7b09 add CancelRequest to discovery round-tripper
Kubernetes-commit: 07eae3a1725c65860d85956f4fda20293a8d0a9e
2018-08-06 11:51:13 -04:00
Kubernetes Publisher
02384dbe12 Merge pull request #66967 from deads2k/kubectl-09-naughty
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 adding internal types to external schemes

at some point someone starting internal types to external schemes in kubectl tests.  This fixes that mistake.

@kubernetes/sig-cli-maintainers
/assign @soltysh

```release-note
NONE
```

Kubernetes-commit: dab04dc6e0103c1778f047594e5405d433cff96c
2018-08-06 13:26:01 +00:00
Kubernetes Publisher
32a482af20 Merge pull request #66837 from deads2k/client-02-panic
Automatic merge from submit-queue (batch tested with PRs 66870, 66929, 66837). 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 panic fake SAR client expansion

if the object is nil, the type assertion fails.

@kubernetes/sig-api-machinery-bugs

```release-note
NONE
```

Kubernetes-commit: a2223e9a9281ca83fd85814c8e7c32b3c8fde53f
2018-08-06 13:25:27 +00:00
Kubernetes Publisher
d0ef5a1c7d Merge pull request #66929 from deads2k/client-03-wrapping-log
Automatic merge from submit-queue (batch tested with PRs 66870, 66929, 66837). 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 logging to find offending transports

When a transport can't be cancelled, we're notified, but we don't which transport is missing the ability.  This adds logging to give us a target type.

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

since you hit it.

```release-note
NONE
```

Kubernetes-commit: 99f96511fdb8438f85ebeb4c22c929c97fabcbb6
2018-08-06 13:25:26 +00:00
Tomas Nozicka
1ab85cc3cc Update Bazel
Kubernetes-commit: 4d7747a5a374ab6ee173b99968b4311d967e1b6b
2018-08-06 14:32:36 +02:00
Tomas Nozicka
f314ed00c1 Update Bazel
Kubernetes-commit: dc2cfd5d208bfdb105d055471b778f0dd87ba99d
2018-08-03 16:46:26 +02:00
Tomas Nozicka
4528feba43 Add UntilWithSync (informer based)
Kubernetes-commit: 866cc1acab6c1c30a7550b2de7160c8052be884d
2018-08-03 16:45:41 +02:00
Tomas Nozicka
6dac86f710 Deprecate ListWatchUntil, fix it and call places
Kubernetes-commit: e434f3189e81e473aa89e3589ca81545d1341cf8
2018-08-03 16:08:28 +02:00
Tomas Nozicka
82acb64076 Move ListWatchUntil to its kin
Kubernetes-commit: 07b8373ab393547239ed4fe227758a1715480f22
2018-08-03 15:22:42 +02:00
David Eads
03b9b1062a stop adding internal types to external schemes
Kubernetes-commit: 8a1eae451bb0c8eb651675cecb46db628208f003
2018-08-03 07:51:44 -04:00
Kubernetes Publisher
30599d9dba Merge pull request #66870 from apelisse/dry-run-client
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>.

dry-run: Update DynamicClient to pass Create/Update options

Change dynamic client to accept Create and Update options on Create/Update/Patch methods.

**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
```

Kubernetes-commit: b90485560185085ae7a8ad3fab60cb417f7654bf
2018-08-02 17:00:29 -07:00
Kubernetes Publisher
453b064209 Merge pull request #66779 from deads2k/api-05-easy-unit
Automatic merge from submit-queue (batch tested with PRs 66850, 66902, 66779, 66864, 66912). 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 methods to apimachinery to easy unit testing

When unit testing, you often want a selective scheme and codec factory.  Rather than writing the vars and the init function and the error handling, you can simply do

`scheme, codecs := testing.SchemeForInstallOrDie(install.Install)`

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

```release-note
NONE
```

Kubernetes-commit: 4a54f3f0d6fe73bcced14442b60981819a1744e2
2018-08-06 13:25:25 +00:00
Kubernetes Publisher
b00d4d1d42 Merge pull request #65799 from dekkagaijin/fix-headers
Automatic merge from submit-queue (batch tested with PRs 66225, 66648, 65799, 66630, 66619). 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>.

Percent-encode illegal characters in user.Info.Extra keys

This percent-encodes characters in `X-Remote-Extra-` and `Impersonate-Extra-` keys which aren't valid for header names per [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.6) (plus "%" to avoid breaking keys which contain them). The API server then blindly unescapes these keys.

Reviewer note:
Old clients sending keys which were `%`-escaped by the user will have their values unescaped by new API servers. New clients sending keys containing illegal characters (or "%") to old API servers will not have their values unescaped. This version skew incompatibility is a compromise discussed in #63682.

Fixes #63682

PTAL @mikedanese

**Release note**:
```release-note
action required: the API server and client-go libraries have been fixed to support additional non-alpha-numeric characters in UserInfo "extra" data keys. Both should be updated in order to properly support extra data containing "/" characters or other characters disallowed in HTTP headers.
```

Kubernetes-commit: 6715f139292bfde5e4030e2e3f8077da04cc6d72
2018-08-06 13:24:39 +00:00
Kubernetes Publisher
7d948ea4ad Merge pull request #66648 from feiskyer/azure-sdk-update
Automatic merge from submit-queue (batch tested with PRs 66225, 66648, 65799, 66630, 66619). 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 Azure Go SDK to v19.0.0 and get availability zone for VirtualMachineScaleSetVM

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

Continue of #66242. This PR updates Azure Go SDK to v19.0.0 (with compute API 2018-04-01) and gets availability zones for VirtualMachineScaleSetVM.

**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
Azure Go SDK has been upgraded to v19.0.0 and VirtualMachineScaleSetVM now supports availability zones.
```

/sig azure
/assign @brendandburns @khenidak @andyzhangx

Kubernetes-commit: c2cbe86f7d647f8608c9963105fe297c9c5f4508
2018-08-06 13:24:39 +00:00
David Eads
5f3a23fd53 add logging to find offending transports
Kubernetes-commit: 8b61c5a08846221503ad039a53e3f38328c9c127
2018-08-02 15:14:27 -04:00
W. Trevor King
045dbe7ac1 client-go/rest: Fix "segments segment" comment typo
The typo landed with SubResource in adb75e1f (generated staging area,
2016-08-06, kubernetes/kubernetes#29147).

Kubernetes-commit: e42aab6430cbc9d14891e9aaada9ec8becf62273
2018-08-02 08:30:44 -07:00
Tomas Nozicka
cbdb98d74d Rename Until to UntilWithoutRetry and move to using context so it's
cancelable

Kubernetes-commit: 3d4a02abb54244861f9f05b8db2fdfdaa2c6f67c
2018-08-02 14:11:59 +02:00
Tomas Nozicka
5764fa1b79 Move Until from apimachinery to client-go
Kubernetes-commit: ccb92f6ef867c9e2ede91b7877a492a161986623
2018-08-01 19:35:46 +02:00
Antoine Pelisse
29424b90cb dry-run: Update DynamicClient to pass Create/Update options
Kubernetes-commit: 71970d6475f6570d933fa9f22be2ebc20a9ace6f
2018-08-01 10:35:43 -07:00
David Eads
b46e3962ed generated
Kubernetes-commit: efb160c945587fbfdde3d7b24952cacb55d90450
2018-08-01 10:18:41 -04:00
David Eads
3e9a51baf5 make package name match all the import aliases
Kubernetes-commit: d3bd0eb1d5cefc25e4476d8dc086ebd90439ef4e
2018-08-01 10:01:32 -04:00
Ibrahim AshShohail
a83d2a2682 change TRUNCATED to DATA+OMITTED in kubectl config view
Signed-off-by: Ibrahim AshShohail <me@ibrasho.com>

Kubernetes-commit: 23996b25c93c0fc576f5d4a547f91e1b7c4b68a3
2018-08-01 03:23:00 +03:00
David Eads
5798b4e636 fix panic fake SAR client expansion
Kubernetes-commit: 13db7c77c968f95b8f5d7b4a041d8e89001e4f7f
2018-07-31 16:17:36 -04:00
Pengfei Ni
93515e7d7f Update staging Godeps
Kubernetes-commit: 4457947e114ae35a524fe9a1b0271607986ed082
2018-07-27 10:13:56 +08:00
Kubernetes Publisher
0b97d57a86 Merge pull request #66395 from awly/fix-kubelet-exec-plugin-startup
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 http.Transport if it already exists in ExecProvider

**What this PR does / why we need it**:
This unbreaks ExecPlugin. Without the change, we hit this error
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/client-go/transport/transport.go#L32

**Release note**:
```release-note
Fix kubelet startup failure when using ExecPlugin in kubeconfig
```

Kubernetes-commit: cef2d325ee1be894e883d63013f75cfac5cb1246
2018-07-26 18:23:31 +00:00
Andrew Lytvynov
dd5f11e1e6 Set connrotation dialer via restclient.Config.Dialer
Instead of Transport. This fixes ExecPlugin, which fails if
restclient.Config.Transport is set.

Kubernetes-commit: 3357b5ecf42db9bcf6e54c9d2b6712cfbae077bf
2018-07-25 16:22:32 -07:00
Kubernetes Publisher
3db81bdd12 Merge pull request #66518 from deads2k/dynamic-02-ordie
Automatic merge from submit-queue (batch tested with PRs 66252, 66518). 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 missing OrDie variant for dynamic client construction

Generated clients have it and it is very handy for test cases.

```release-note
NONE
```

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

Kubernetes-commit: 6764a795869d2631eb75f222f776ec5a80b61e37
2018-07-24 10:21:32 +00:00
David Eads
875f881c7c add missing OrDie variant for dynamic client construction
Kubernetes-commit: 75e28b0dd48a3a2d90d1bbb8133114134c6d0528
2018-07-23 16:29:35 -04:00
Kubernetes Publisher
739dd8f9d4 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
```

Kubernetes-commit: 24fc97a82810671c76a7bc9fd57a9cd7719dcd37
2018-07-19 23:52:51 +00:00
Kubernetes Publisher
d6a5799477 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
```

Kubernetes-commit: d2cc34fb07138deeacb220126e76a0cb279f340b
2018-07-19 19:53:34 +00:00
Kubernetes Publisher
8ffec625de 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
```

Kubernetes-commit: 7f912af75ce4794b0cf089103a0e83f1f6a61d2f
2018-07-19 15:53:03 +00:00
Kubernetes Publisher
4e3d951df3 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
```

Kubernetes-commit: da1bb028304504cbe33e5dab42290e1e8ea12d14
2018-07-17 10:20:20 -07:00
Kubernetes Publisher
919235c0c3 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
```

Kubernetes-commit: bfba154715012b63a3fcc8320cc48986304f819c
2018-07-17 11:43:30 +00:00
Kubernetes Publisher
26fe45c84c Merge pull request #66254 from sigma/patch-1
Automatic merge from submit-queue (batch tested with PRs 66172, 66254). 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: update documentation for remotecommand.StreamOptions

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

The ability to explicitly define the supported protocols was removed in commit 12c7874c0d88e9099ab2a29915d26751f0d23c2a
Adjust documentation accordingly.

**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
```

Kubernetes-commit: e09be82ad04107f81032b82a1e2452759001819f
2018-07-17 11:42:58 +00:00