Commit Graph

2144 Commits (f32b390cf08a9afd9f9899e0d97a90eb162b32a8)

Author SHA1 Message Date
Jordan Liggitt 31d45fe78f
Generated files 2017-02-06 18:16:51 -05:00
deads2k 0a536544b4 add liggitt to apimachinery/apiserver packages 2017-02-03 12:24:22 -05:00
Michael Fraenkel 93c11422e4 CRI Portforward needs to forward websocket ports
- adjust ports to int32
- CRI flows the websocket ports as query params

- Do not validate ports since the protocol is unknown
  SPDY flows the ports as headers and websockets uses query params
- Only flow query params if there is at least one port query param
2017-02-01 18:03:42 -07:00
Michael Fraenkel beb53fb71a Port forward over websockets
- split out port forwarding into its own package

Allow multiple port forwarding ports
- Make it easy to determine which port is tied to which channel
- odd channels are for data
- even channels are for errors

- allow comma separated ports to specify multiple ports

Add  portfowardtester 1.2 to whitelist
2017-02-01 06:32:04 -07:00
deads2k 8a12000402 move client/record 2017-01-31 19:14:13 -05:00
deads2k 700c30f3c7 move portforward to client-go 2017-01-31 14:13:35 -05:00
Jordan Liggitt aa4a3e1613
Regenerate clients 2017-01-31 11:16:27 -05:00
Jordan Liggitt c4e52d3df2
Regenerate listers/informers 2017-01-30 15:46:36 -05:00
Dr. Stefan Schimanski 44ea6b3f30 Update generated files 2017-01-29 21:41:45 +01:00
Dr. Stefan Schimanski 79adb99a13 pkg/api: move Semantic equality to k8s.io/apimachinery/pkg/api/equality 2017-01-29 21:41:45 +01:00
Dr. Stefan Schimanski 674d78b2ab pkg/util: move httpstream to k8s.io/apimachinery 2017-01-27 15:10:42 -05:00
deads2k 9488e2ba30 move testing/core to client-go 2017-01-26 13:54:40 -05:00
deads2k 2734f8f892 move dynamic and discovery clients 2017-01-26 08:37:06 -05:00
Dr. Stefan Schimanski a0137e9b28 Update generated files 2017-01-25 19:49:45 +01:00
Dr. Stefan Schimanski d7eb3b6870 pkg/util: move uuid and strategicpatch into k8s.io/apimachinery 2017-01-25 19:45:09 +01:00
deads2k 502bfdf944 client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
deads2k 3eeecb0848 preserve client tests that can't move to client-go 2017-01-25 08:29:48 -05:00
deads2k b0b156b381 make tools/cache authoritative 2017-01-25 08:29:45 -05:00
Clayton Coleman be6d2933df
refactor: Move *Options references to metav1 2017-01-24 13:41:51 -05:00
Clayton Coleman 7b1c715496
generated: Move references to metav1.*Options 2017-01-24 13:41:48 -05:00
deads2k 5a8f075197 move authoritative client-go utils out of pkg 2017-01-24 08:59:18 -05:00
Clayton Coleman 9009c1ac14
generated: informer,client 2017-01-23 17:52:47 -05:00
Clayton Coleman 469df12038
refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
Clayton Coleman 245b592fac
Convert core code to metav1.ListOptions 2017-01-23 17:52:45 -05:00
Clayton Coleman df831db360
Break dependency on testapi from core packages 2017-01-23 16:53:13 -05:00
deads2k 335ef747d6 mechanical 2017-01-23 10:03:55 -05:00
Kubernetes Submit Queue 66c59e491e Merge pull request #40240 from ncdc/shared-informers-01
Automatic merge from submit-queue (batch tested with PRs 40232, 40235, 40237, 40240)

Expose ForResource in generated informer factory, copy lister expansions

Expose ForResource in generated informer factory

Copy lister expansions from pkg/client/cache into pkg/client/listers

@deads2k
2017-01-20 14:22:53 -08:00
Kubernetes Submit Queue 470e732d7f Merge pull request #40235 from deads2k/generic-26-listers
Automatic merge from submit-queue (batch tested with PRs 40232, 40235, 40237, 40240)

move listers out of cache to reduce import tree

Moving the listers from `pkg/client/cache` snips links to all the different API groups from `pkg/storage`, but the dreaded `ListOptions` remains.

@sttts
2017-01-20 14:22:51 -08:00
Kubernetes Submit Queue b5929bfb2b Merge pull request #38789 from jessfraz/cleanup-temp-dirs
Automatic merge from submit-queue (batch tested with PRs 37228, 40146, 40075, 38789, 40189)

Cleanup temp dirs

So funny story my /tmp ran out of space running the unit tests so I am cleaning up all the temp dirs we create.
2017-01-20 12:34:58 -08:00
deads2k 1ce0637b27 move listers out of cache to reduce import tree 2017-01-20 15:01:38 -05:00
Andy Goldstein e5dd576b31 Copy lister expansions
Copy lister expansions from pkg/client/cache into pkg/client/listers
2017-01-20 12:41:37 -05:00
Andy Goldstein 307acab3f3 Expose ForResource in generated informer factory 2017-01-20 12:41:37 -05:00
deads2k 9c6a522882 mechanical results of client auth plugin 2017-01-20 08:05:18 -05:00
deads2k ee6752ef20 find and replace 2017-01-20 08:04:53 -05:00
deads2k c587b8a21e re-run client-gen 2017-01-20 08:02:36 -05:00
deads2k 32a2c2d05c remove old restclient 2017-01-20 07:56:35 -05:00
Kubernetes Submit Queue 4e3488ee99 Merge pull request #39831 from jessfraz/fix-38774
Automatic merge from submit-queue (batch tested with PRs 39772, 39831, 39481, 40167, 40149)

Check if error is Status in result.Stream()

Fix #38774

This adds the same functionality to `.Stream()` that was added to `.Error()`, `.Into()`, and `.Get()` in ce187f9c6a to try decoding the body as a Status.

This broke `.Stream()` because the decoding of the body as `Status` was removed from `transformResponse` in ce187f9c6a (diff-de85e3effc36b7bbe3fb9eae6c833cf3L933)
2017-01-19 17:56:45 -08:00
Mike Danese 44b7246568 autogenerated 2017-01-19 14:24:45 -08:00
deads2k 11e8068d3f move pkg/fields to apimachinery 2017-01-19 09:50:16 -05:00
deads2k c47717134b move utils used in restclient to client-go 2017-01-19 07:55:14 -05:00
deads2k 6c6616b41c move restclient/watch 2017-01-19 07:39:20 -05:00
deads2k cdb2934bbc remove kubernetes copy of clientcmd types 2017-01-19 07:39:19 -05:00
Kubernetes Submit Queue 723fa08767 Merge pull request #39324 from wojtek-t/change_patch_api
Automatic merge from submit-queue

Prepare for using optimized conversion to/from map[string]interface{} in Patch operation

Ref #39017
2017-01-19 00:50:12 -08:00
Jess Frazelle 502a34e8dc
Check if error is Status in result.Stream()
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-01-18 11:59:27 -08:00
Kubernetes Submit Queue 302d3ab1d7 Merge pull request #39625 from deads2k/rbac-36-beta
Automatic merge from submit-queue (batch tested with PRs 39625, 39842)

Add RBAC v1beta1

Add `rbac.authorization.k8s.io/v1beta1`.  This scrubs `v1alpha1` to remove cruft, then add `v1beta1`.  We'll update other bits of infrastructure to code to `v1beta1` as a separate step.

```release-note
The `attributeRestrictions` field has been removed from the PolicyRule type in the rbac.authorization.k8s.io/v1alpha1 API. The field was not used by the RBAC authorizer.
```

@kubernetes/sig-auth-misc @liggitt @erictune
2017-01-18 10:19:11 -08:00
deads2k d1fec7068f generated 2017-01-18 10:35:46 -05:00
deads2k 4f915039e4 move pkg/client/transport to client-go 2017-01-18 07:56:01 -05:00
Wojciech Tyczynski d08abdb187 Allow for returning map[string]interface{} from patch. 2017-01-18 11:53:30 +01:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
Clayton Coleman 36acd90aba
Move APIs and core code to use metav1.ObjectMeta 2017-01-17 16:17:18 -05:00
Kubernetes Submit Queue e5fe366eaf Merge pull request #39894 from deads2k/client-03-remove-old
Automatic merge from submit-queue

Remove packages which are now apimachinery

Removes all the content from the packages that were moved to `apimachinery`.  This will force all vendoring projects to figure out what's wrong.  I had to leave many empty marker packages behind to have verify-godep succeed on vendoring heapster.

@sttts straight deletes and simple adds
2017-01-17 12:00:00 -08:00
Kubernetes Submit Queue f7305e6f43 Merge pull request #39974 from deads2k/api-60-move-patch
Automatic merge from submit-queue

Move PatchType to apimachinery/pkg/types

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

`PatchType` is shared by the client and server, they have to agree, and its critical for our API to function.

@smarterclayton @kubernetes/sig-api-machinery-misc
2017-01-17 07:29:06 -08:00
deads2k f31ecdd0f7 generated changes 2017-01-17 08:32:05 -05:00
deads2k 26c46971f2 move PatchType to apimachinery 2017-01-17 08:32:05 -05:00
deads2k 67fac70ea3 remove files moved to apimachinery 2017-01-17 07:46:34 -05:00
Dr. Stefan Schimanski 52f6831576 genericapiserver: cut off kube pkg/version dependency 2017-01-17 12:34:05 +01:00
Kubernetes Submit Queue 6defc30337 Merge pull request #39882 from deads2k/api-59-errors
Automatic merge from submit-queue (batch tested with PRs 38592, 39949, 39946, 39882)

move api/errors to apimachinery

`pkg/api/errors` is a set of helpers around `meta/v1.Status` that help to create and interpret various apiserver errors.  Things like `.NewNotFound` and `IsNotFound` pairings.  This pull moves it into apimachinery for use by the clients and servers.

@smarterclayton @lavalamp First commit is the move plus minor fitting.  Second commit is straight replace and generation.
2017-01-16 10:37:42 -08:00
Kubernetes Submit Queue 4811ad0231 Merge pull request #38592 from krousey/client-context
Automatic merge from submit-queue (batch tested with PRs 38592, 39949, 39946, 39882)

Add optional per-request context to restclient

**What this PR does / why we need it**: It adds per-request contexts to restclient's API, and uses them to add timeouts to all proxy calls in the e2e tests. An entire e2e shouldn't hang for hours on a single API call.

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

**Special notes for your reviewer**:

This adds a feature to the low-level rest client request feature that is entirely optional. It doesn't affect any requests that don't use it. The api of the generated clients does not change, and they currently don't take advantage of this.

I intend to patch this in to 1.5 as a mostly test only change since it's not going to affect any controller, generated client, or user of the generated client.


cc @kubernetes/sig-api-machinery 
cc @saad-ali
2017-01-16 10:37:38 -08:00
deads2k 77b4d55982 mechanical 2017-01-16 09:35:12 -05:00
Kubernetes Submit Queue e73e749459 Merge pull request #39679 from errows/fix_sucessfully_typos
Automatic merge from submit-queue (batch tested with PRs 39417, 39679)

Fix 2 `sucessfully` typos

**What this PR does / why we need it**: Only fixes two typos in comments/logging

**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
```
2017-01-14 19:51:09 -08:00
Kubernetes Submit Queue 6b5d82b512 Merge pull request #37505 from k82cn/use_controller_inf
Automatic merge from submit-queue (batch tested with PRs 39807, 37505, 39844, 39525, 39109)

Made cache.Controller to be interface.

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

#37504
2017-01-13 13:40:41 -08:00
Kubernetes Submit Queue a6fa5c2bfd Merge pull request #39814 from deads2k/api-58-multi-register
Automatic merge from submit-queue

replace global registry in apimachinery with global registry in k8s.io/kubernetes

We'd like to remove all globals, but our immediate problem is that a shared registry between k8s.io/kubernetes and k8s.io/client-go doesn't work.  Since client-go makes a copy, we can actually keep a global registry with other globals in pkg/api for now.

@kubernetes/sig-api-machinery-misc @lavalamp @smarterclayton @sttts
2017-01-13 12:37:02 -08:00
deads2k f1176d9c5c mechanical repercussions 2017-01-13 08:27:14 -05:00
Klaus Ma 25fe1e0d82 Made cache.Controller to be interface. 2017-01-13 13:33:23 +08:00
NickrenREN a12dea14e0 fix redundant alias clientset 2017-01-12 10:21:05 +08:00
Kubernetes Submit Queue 931bccf907 Merge pull request #38666 from tanshanshan/empty-check
Automatic merge from submit-queue (batch tested with PRs 39475, 38666, 39327, 38396, 39613)

Add checking the nil value 

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

Add checking the nil value.

Thanks.

**Special notes for your reviewer**:
2017-01-11 09:14:52 -08:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
tanshanshan 7d4b594c64 check nil 2017-01-11 11:35:36 +08:00
Marc-Antoine Ross c01c7023a0 Fix 2 `sucessfully` typos 2017-01-10 10:37:45 -05:00
Clayton Coleman 5c4fccba88
generated: change to WatchEvent from Event 2017-01-06 23:45:05 -05:00
Clayton Coleman f07c6486ba
Rename metav1.Event to metav1.WatchEvent to avoid swagger collision
The kind on this object was always WatchEvent
2017-01-06 23:45:04 -05:00
Clayton Coleman c5d755dbec
Refactor tests to match new versioned code structure 2017-01-06 23:45:03 -05:00
Clayton Coleman e5019de260
refactor: Move versioned/watch to meta/v1 2017-01-06 23:45:03 -05:00
Clayton Coleman b7d03ed3d5
Move watch/versioned to pkg/apis/meta/v1/watch.go
Move the encoder and decoder to restclient since it is generic to that
package.
2017-01-06 23:45:00 -05:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Jess Frazelle db75904b42
fix when os.Remove should be os.RemoveAll
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-01-04 10:34:06 -08:00
Jeff Grafton fae627dd65 Update generated for 2017 2017-01-01 23:11:09 -08:00
Mike Danese 161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
Wojciech Tyczynski 9a4828821d Retry connection reset by peer 2016-12-27 10:01:42 +01:00
Fabiano Franz bdea92bccd In-cluster configs must take flag overrides into account 2016-12-22 14:22:01 -02:00
Daniel Smith ae461f8a1f Update OWNERS 2016-12-19 16:05:48 -08:00
Antoine Pelisse 491fe7fde0 Update OWNERS approvers and reviewers: pkg/client 2016-12-19 16:04:55 -08:00
Maciej Szulik cdec94523e Remove extensions/v1beta1 Job - generated changes 2016-12-17 00:07:25 +01:00
Maciej Szulik 9f064c57ce Remove extensions/v1beta1 Job 2016-12-17 00:07:24 +01:00
Mike Danese 8fdec87d19 bazel: fix some unit tests 2016-12-15 18:36:22 -08:00
Kubernetes Submit Queue 4d467de5c5 Merge pull request #37708 from juanvallejo/jvallejo/add-restclient-config-helper-for-parsing-global-timeout
Automatic merge from submit-queue (batch tested with PRs 37708, 34410)

Add restclientconfig helper fn for parsing timeout

Related downstream PR: https://github.com/openshift/origin/pull/12062 (example of use-case for this patch)

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

This patch adds a package `pkg/client/unversioned/clientcmd/util` and
defines a `ParseTimeout` helper function for parsing time from a
user-defined string. This allows code re-use in other packages that
require the creation of a new restclient (and therefore must set the
`--global-timeout` flag value manually).

@fabianofranz @kubernetes/cli-review
2016-12-14 15:09:50 -08:00
Kubernetes Submit Queue d8efc779ed Merge pull request #38154 from caesarxuchao/rename-release_1_5
Automatic merge from submit-queue (batch tested with PRs 38154, 38502)

Rename "release_1_5" clientset to just "clientset"

We used to keep multiple releases in the main repo. Now that [client-go](https://github.com/kubernetes/client-go) does the versioning, there is no need to keep releases in the main repo. This PR renames the "release_1_5" clientset to just "clientset", clientset development will be done in this directory.

@kubernetes/sig-api-machinery @deads2k 

```release-note
The main repository does not keep multiple releases of clientsets anymore. Please find previous releases at https://github.com/kubernetes/client-go
```
2016-12-14 14:21:51 -08:00
Kris 8070548ebe Add Context() to enable per-request cancellation 2016-12-14 13:14:11 -08:00
Chao Xu 6709b7ada2 run hack/update-codegen.sh
run hack/verify-gofmt.sh
update bazel
2016-12-14 12:39:49 -08:00
Chao Xu 28c2ed2c8d manually update import_known_versions.go 2016-12-14 12:39:49 -08:00
Chao Xu 03d8820edc rename /release_1_5 to /clientset 2016-12-14 12:39:48 -08:00
Kubernetes Submit Queue bf7daae954 Merge pull request #38724 from deads2k/fed-12-fix-exec
Automatic merge from submit-queue

fix connection upgrades through kuberentes-discovery

The initial upgrade through the proxy doesn't use the passed transport to handle the communication to the remote side.  Since we need auth proxy headers, this broke the upgrade for exec.

This sets those headers once if its an upgrade request (the transport stomps them if called anyway, so it won't shadow.).

@sttts I think this is the last required piece.  Then we start wiring in for e2e.
2016-12-14 07:45:04 -08:00
Kubernetes Submit Queue bd522d1daa Merge pull request #38648 from sykesm/fake-propagates-ns
Automatic merge from submit-queue

Fake clientset propagates namespace to objects on create/update

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

Unlike the real Clientset, the fake Clientset requires creates and updates of namespaced objects to have the namespace specified in the target runtime object metadata. This difference forces API clients using the fake Clientset for test to propagate the namespaces to the runtime objects in the production code. This propagation is unnecessary and should be handled by the fake implementation.

**Which issue this PR fixes**: fixes kubernetes/client-go#48

**Special notes for your reviewer**:

**Release note**:
NONE
2016-12-14 03:46:15 -08:00
Tim St. Clair bc3ade7454
Refactor remotecommand options parsing 2016-12-13 16:09:23 -08:00
deads2k cd5f8a85f0 support exec through discovery 2016-12-13 15:55:54 -05:00
Matthew Sykes c55d9a2d35 Propagate namespace to objects on create/update 2016-12-13 10:41:46 -05:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Kubernetes Submit Queue 9e6b090804 Merge pull request #38570 from smarterclayton/cleanup_body_logging
Automatic merge from submit-queue (batch tested with PRs 38597, 38570)

Logging request / response body should not allocate

Putting string(data) in the critical path causes an allocation which can
be very large, and happens regardless of whether logging is enabled.

Also, use the more sophisticated logging of body output that avoids
causing quoting of JSON output (current behavior is "{\"key\":...}" and
should be {"key":...} for readability).

@wojtek-t reduces large heap allocations on updates
2016-12-12 01:24:04 -08:00
Clayton Coleman ea2ab71f4b
Logging request / response body should not allocate
Putting string(data) in the critical path causes an allocation which can
be very large, and happens regardless of whether logging is enabled.

Also, use the more sophisticated logging of body output that avoids
causing quoting of JSON output (current behavior is "{\"key\":...}" and
should be {"key":...} for readability).
2016-12-10 19:27:17 -05:00
Clayton Coleman c52d510a24
refactor: generated 2016-12-10 18:05:53 -05:00
Clayton Coleman 42d410fdde
Switch to use pkg/apis/meta/v1/unstructured and the new interfaces
Avoid directly accessing an unstructured type if it is not required.
2016-12-10 18:05:28 -05:00
Davanum Srinivas bbd04cde41 Better deal with failures under golang 1.8beta1
If there is any error in the initial parsing then we should just
try adding the scheme.

url.Parse(base) has changed in 1.8. Please see the following change
c5ccbdd22b

Fixes #38380
2016-12-09 14:15:02 -05:00
Wojciech Tyczynski aa7da5231f Update bazel files 2016-12-09 09:42:02 +01:00
Wojciech Tyczynski e8d1cba875 GetOptions in client calls 2016-12-09 09:42:01 +01:00
Wojciech Tyczynski cff55e5894 Autogenerate clients 2016-12-09 09:42:01 +01:00
Jordan Liggitt da15bd9260
Update client status generator to not use json tags 2016-12-08 21:58:01 -05:00
Kubernetes Submit Queue 129413aabd Merge pull request #38413 from timothysc/leaselogs
Automatic merge from submit-queue (batch tested with PRs 38413, 37164)

Update leaderelection logging per user feedback.

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

Cleans up log spam, per user feedback. 

fixes #34594

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```
NONE
```
2016-12-08 18:08:52 -08:00
Kubernetes Submit Queue a4c9c32657 Merge pull request #37998 from ymqytw/add_test_for_concurrent_evictions
Automatic merge from submit-queue (batch tested with PRs 36071, 32752, 37998, 38350, 38401)

Add test for concurrent evictions requests

This is a followup PR after #37668.
Add a test case to make sure concurrent eviction requests can be handled.

@davidopp @lavalamp
2016-12-08 16:25:56 -08:00
Timothy St. Clair ad5f323ff7 Update leaderelection logging per user feedback.
Fixes #34594
2016-12-08 15:46:06 -06:00
Kubernetes Submit Queue 1199d42210 Merge pull request #36702 from fabxc/client-metrics
Automatic merge from submit-queue (batch tested with PRs 37701, 36702, 37145, 37424, 38261)

Limit unbound label cardinality on request errors

This converts all request errors to the string `<error>` instead of
passing the full error string. Error strings can have arbitrary values
and thus have a cardinality that is not suitable for a metric
use case.

Inspecting individual errors is a logging use case which can be handled separately by registering a client error handler.

@kubernetes/sig-instrumentation
2016-12-08 04:39:20 -08:00
Kubernetes Submit Queue 9a89e8cdcb Merge pull request #35679 from xilabao/fix-repeat-request-for-auth
Automatic merge from submit-queue (batch tested with PRs 35884, 37305, 37369, 37429, 35679)

fix repeat request for auth

reference to  #27851

When use basic-auth/RBAC, don't set the users in .kube/config

```
# cat ~/.kube/config
apiVersion: v1
clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: https://127.0.0.1:6443
  name: ubuntu
contexts:
- context:
    cluster: ubuntu
    namespace: default
    user: test
  name: ubuntu
current-context: ubuntu
kind: Config
preferences: {}
users: []
```

kubectl request for username/password  time after time

```
$ kubectl get nodes
Please enter Username: admin
Please enter Password: ******
Please enter Username: admin
Please enter Password: ******
```
2016-12-08 03:55:19 -08:00
Kubernetes Submit Queue d9414bca99 Merge pull request #37463 from tanshanshan/comment-modify
Automatic merge from submit-queue (batch tested with PRs 36626, 37294, 37463, 37943, 36541)

Modify wrong comment

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

Modify wrong comment

Thanks!

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-12-08 00:23:13 -08:00
ymqytw 83a0373926 copy eviction from internal clientset to release_1_5 clientset 2016-12-07 13:24:34 -08:00
deads2k 8ae8bf02a4 regenerate informers 2016-12-07 07:54:04 -05:00
deads2k 97854b8de5 update informer generator 2016-12-07 07:48:24 -05:00
Kubernetes Submit Queue 653fd97ba0 Merge pull request #37966 from p0lyn0mial/unify_restmapping_and_restmappings
Automatic merge from submit-queue (batch tested with PRs 38185, 37966)

decided to extract common logic for RESTMapping and RESTMappings to a…

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**: the changes introduced in this PR extract common logic of RESTMapping and RESTMappings to one common method. 

**Special notes for your reviewer**: this is my first PR - be polite.



The only change in logic to what was before is when calling commonRESTMappings from RESTMapping
we search all defaultGroupVersion as opposed to just one when no mapping was found for provided versions.
2016-12-06 06:49:25 -08:00
p0lyn0mial 5f8e774517 extended RESTMappings method by a version parameter.
RESTMapping method can now rely on RESTMappings by passing versions parameter and taking the first match found by RESTMappings method. In addition
a UT that test the new method has been added.

The only change in logic to what was before is when calling RESTMapping
we search all defaultGroupVersion as opposed to just one when no mapping was found for provided versions.
2016-12-05 20:09:36 +01:00
Kubernetes Submit Queue 45a436ac24 Merge pull request #36909 from sttts/sttts-discovery-with-verbs
Automatic merge from submit-queue (batch tested with PRs 37370, 37003, 36909)

Add verbs to APIResourceInfo for discovery

Verbs will be used by generic controllers (gc, namespace) to avoid unnecessary API calls, reducing load on the apiserver. E.g. not all objects can be deleted.

Example:
```json
{
  "kind": "APIResourceList",
  "apiVersion": "v1",
  "groupVersion": "batch/v1",
  "resources": [
    {
      "name": "jobs",
      "namespaced": true,
      "kind": "Job",
      "verbs": [
        "create",
        "delete",
        "deletecollection",
        "get",
        "list",
        "update",
        "watch"
      ]
    },
    {
      "name": "jobs/status",
      "namespaced": true,
      "kind": "Job",
      "verbs": [
        "create",
        "get"
      ]
    }
  ]
}
```
2016-12-05 06:48:41 -08:00
deads2k 61b5585bac add auth proxy roundtripper 2016-12-05 08:18:47 -05:00
Dr. Stefan Schimanski 2dff13f332 Update generated files 2016-12-05 12:42:31 +01:00
Dr. Stefan Schimanski 458d2b2fe4 Add verb support for discovery client 2016-12-05 12:36:05 +01:00
Kubernetes Submit Queue 68ca638164 Merge pull request #35672 from zlabjp/fix-list-and-watch-goroutine-leak
Automatic merge from submit-queue

Fix resync goroutine leak in ListAndWatch

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

This PR fixes resync goroutine leak in ListAndWatch function

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

fixes #35015

**Special notes for your reviewer**:

**Release note**:

<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->

``` release-note
```

Previously, we had no way to stop resync goroutine when ListAndWatch
returned.  goroutine leaked every time ListAndWatch returned, for
example, with error.  This commit adds another channel to signal that
resync goroutine should exit when ListAndWatch returns.
2016-12-05 02:41:33 -08:00
Kubernetes Submit Queue ce0d2ac8ee Merge pull request #37688 from nvartolomei/reflector-handle-store-errors
Automatic merge from submit-queue

Add error handling for store operations in cache/reflector

In my opinion the errors there should be returned, but to have minimal impact I just added runtime error handler.

Let me know what you think.
2016-12-04 10:04:45 -08:00
Clayton Coleman 3454a8d52c
refactor: update bazel, codec, and gofmt 2016-12-03 19:10:53 -05:00
Clayton Coleman 5df8cc39c9
refactor: generated 2016-12-03 19:10:46 -05:00
Kubernetes Submit Queue f3d463f114 Merge pull request #37643 from ncdc/informer-gen
Automatic merge from submit-queue (batch tested with PRs 35300, 36709, 37643, 37813, 37697)

Add generated informers

Add informer-gen and the informers it generates. We'll do follow-up PRs to convert everything currently using the hand-written informers to the generated ones.

TODO:

- [x] switch to `GroupVersionResource`
- [x] finish godoc

@deads2k @caesarxuchao @sttts @liggitt
2016-12-03 08:55:57 -08:00
Kubernetes Submit Queue ee3289cce5 Merge pull request #36755 from deads2k/cli-09-extend-impersonate
Automatic merge from submit-queue (batch tested with PRs 36263, 36755, 37357, 37222, 37524)

add other impersonation fields to transport

Adds the group and extra fields to the impersation options in a rest and transport config.

@kubernetes/sig-auth
2016-12-02 16:26:45 -08:00
juanvallejo 885b7a6da8 Add restclientconfig helper fn for parsing timeout
This patch adds a package `pkg/client/unversioned/clientcmd/util` and
defines a `ParseTimeout` helper function for parsing time from a
user-defined string. This allows code re-use in other packages that
require the creation of a new restclient (and therefore must set the
`--global-timeout` flag value manually).
2016-12-02 13:25:03 -05:00
Tatsuhiro Tsujikawa 991674380b Fix resync goroutine leak in ListAndWatch
Previously, we had no way to stop resync goroutine when ListAndWatch
returned.  goroutine leaked every time ListAndWatch returned, for
example, with error.  This commit adds another channel to signal that
resync goroutine should exit when ListAndWatch returns.
2016-12-02 15:26:25 +09:00
Nicolae Vartolomei c6733f1c9e Handle cache/reflector errors when updating objects in store 2016-12-01 21:09:28 +02:00
Andy Goldstein 3bc87f9338 Add generated informers 2016-11-30 09:17:12 -05:00
tanshanshan 64cab5e8b3 modify wrong comment 2016-11-30 09:54:41 +08:00
Clayton Coleman 35a6bfbcee
generated: refactor 2016-11-23 22:30:47 -06:00
Chao Xu bcc783c594 run hack/update-all.sh 2016-11-23 15:53:09 -08:00
Chao Xu 98a82de6d1 dependencies: pkg/client 2016-11-23 15:53:09 -08:00
ymqytw 3cc294b1e0 Revert "support patch list of primitives"
This reverts commit 34891ad9f6.
2016-11-22 21:06:36 -08:00
ymqytw d248843b65 Revert "try old patch after new patch fails"
This reverts commit f32696e734.
2016-11-22 21:02:30 -08:00
xilabao 8d4df82d56 fix repeat request for auth 2016-11-22 11:17:38 +08:00
Kubernetes Submit Queue 0fd70a4990 Merge pull request #36444 from soltysh/issue31481
Automatic merge from submit-queue

Read all resources for finalization and gc, not just preferred

Fixes #31481. 

Currently when starting namespace controller or garbage collector we only gather preferred version resources, which in case of multiple versions (you guessed it `batch/v2alpha1.CronJobs` again) isn't sufficient. This PR adds additional method which actually retrieves all resources from all versions and works on them.

@kubernetes/sig-api-machinery ptal
2016-11-21 15:19:59 -08:00
Maciej Szulik 4401c814fc Read resources from all versions for finalization and gc
If the same resource exists in more then one version, only the preferred
version one will be returned.
2016-11-18 23:31:52 +01:00
ymqytw f32696e734 try old patch after new patch fails 2016-11-17 14:28:09 -08:00
deads2k ef19bf8413 add other impersonation fields to transport 2016-11-15 08:10:30 -05:00
Fabian Reinartz a247736f2a Limit unbound label cardinality on request errors
This converts all request errors to the string `<error>` instead of
passing the full error string. Error strings can have arbitrary values
and thus have a cardinality that is not suitable for a metric
use case.
2016-11-12 18:37:20 +01:00
Kubernetes Submit Queue 3e169be887 Merge pull request #35647 from ymqytw/patch_primitive_list
Automatic merge from submit-queue

Fix strategic patch for list of primitive type with merge sementic

Fix strategic patch for list of primitive type when the patch strategy is `merge`.
Before: we cannot replace or delete an item in a list of primitive, e.g. string, when the patch strategy is `merge`. It will always append new items to the list.
This patch will generate a map to update the list of primitive type.
The server with this patch will accept either a new patch or an old patch.
The client will found out the APIserver version before generate the patch.

Fixes #35163, #32398

cc: @pwittrock @fabianofranz 

``` release-note
Fix strategic patch for list of primitive type when patch strategy is `merge` to remove deleted objects.
```
2016-11-11 14:36:44 -08:00
Marcin 324368ea98 Switch pod eviction client from v1alpha1 to v1beta. 2016-11-11 19:34:29 +01:00
Kubernetes Submit Queue 850f2bf1fd Merge pull request #35382 from jbeda/nits
Automatic merge from submit-queue

Expand documentation and TODOs in a few packages

I was reading through unfamiliar code and mostly added TODOs and expanded and clarified documentations.

There are a couple of things that are real code changes:
- Removed some unused constants
- Changed `workqueue.Parallize` to clamp the number of worker goroutines to the number of items to be processed.
- Added another unit test to `workqueue.queue`.  I thought I found a bug (I was wrong) and wrote a unit test to isolate.  I figure the extra test is worth keeping.
2016-11-10 17:48:06 -08:00
ymqytw 34891ad9f6 support patch list of primitives 2016-11-09 11:46:59 -08:00
Kubernetes Submit Queue 866293b704 Merge pull request #33366 from rhcarvalho/execincontainer-timeout-argument
Automatic merge from submit-queue

Add timeout argument to ExecInContainer

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**: This is related to https://github.com/kubernetes/kubernetes/issues/26895. It brings a timeout to the signature of `ExecInContainer` so that we can take timeouts into account in the future. Unlike my first attempt in https://github.com/kubernetes/kubernetes/pull/27956, it doesn't immediately observe the timeout, because it is impossible to do it with the current state of the Docker Remote API (the default exec handler implementation).

**Special notes for your reviewer**: This shares commits with https://github.com/kubernetes/kubernetes/pull/27956, but without some of them that have more controversial implications (actually supporting the timeouts). The original PR shall be closed in the current state to preserve the history (instead of dropping commits in that PR).

Pinging the original people working on this change: @ncdc @sttts @vishh @dims 

**Release note**:

<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->

``` release-note
NONE
```
2016-11-08 01:41:19 -08:00
Kubernetes Submit Queue 13cc43af82 Merge pull request #35483 from ymqytw/use_evict_for_drain
Automatic merge from submit-queue

Fix kubectl drain for statefulset

Support deleting pets for `kubectl drain`. 
Use evict to delete pods.

Fixes: #33727

```release-note
Adds support for StatefulSets in kubectl drain.
Switches to use the eviction sub-resource instead of deletion in kubectl drain, if server supports.
```

@foxish @caesarxuchao
2016-11-07 17:42:08 -08:00
ymqytw b73fae6c55 Fix kubectl drain for statefulset and use eviciton for drain if possible 2016-11-07 16:13:06 -08:00