Commit Graph

2217 Commits (56dc8f9a6ab09debeddf5349ee26730d3e9107f8)

Author SHA1 Message Date
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
Rodolfo Carvalho 506129ba4e Add timeout argument to ExecInContainer
This allows us to interrupt/kill the executed command if it exceeds the
timeout (not implemented by this commit).

Set timeout in Exec probes. HTTPGet and TCPSocket probes respect the
timeout, while Exec probes used to ignore it.

Add e2e test for exec probe with timeout. However, the test is skipped
while the default exec handler doesn't support timeouts.
2016-11-07 13:00:59 +01:00
Maciej Szulik 8216e47b6a Generated changes 2016-11-07 11:26:50 +01:00
Maciej Szulik 41d88d30dd Rename ScheduledJob to CronJob 2016-11-07 10:14:12 +01:00
Kubernetes Submit Queue f7e0c6c19e Merge pull request #35418 from sttts/sttts-discovery-cache
Automatic merge from submit-queue

Add caching for discovery info with invalidation on cache-miss

TODO:
- [x] write tests for `CachedDiscoveryClient`
- [x] write tests for `DeferredDiscoveryRESTMapper` on cache-miss
- [x] find better way/structure to get rid of `invalidateCh` in c06ba3175b
2016-11-06 20:10:57 -08:00
Kubernetes Submit Queue 5396cbf2a6 Merge pull request #36038 from caesarxuchao/add-versioned-expansions
Automatic merge from submit-queue

Add missing expansion files to versioned clientset

I copied the expansion functions that only existed in the internalclientset to release_1_5.

Most changes are mechanical. This is needed for migrating k8s to use versioned clientset, so I add the 1.5 milestone.
2016-11-06 11:38:11 -08:00
Dr. Stefan Schimanski c8513c31a1 Update bazel 2016-11-04 21:17:12 +01:00
Dr. Stefan Schimanski 14ce6f6065 Add caching for discovery info 2016-11-04 21:17:12 +01:00
Joe Beda e0c6bf13b1
TODOs around stopping informers 2016-11-04 09:28:11 -07:00
Joe Beda 453bb17c3c
Remove constants that are no longer referenced 2016-11-04 09:28:11 -07:00
Andy Goldstein 8c923faf74 Switch to JobLister 2016-11-03 20:41:40 -04:00
Andy Goldstein 8e10413468 Regenerate listers 2016-11-03 20:41:32 -04:00
Kubernetes Submit Queue f0ca9fbd9e Merge pull request #35567 from mwielgus/allowed_disruptions_b2
Automatic merge from submit-queue

Switch DisruptionBudget api from bool to int allowed disruptions [only v1beta1]

Continuation of #34546. Apparently it there is some bug that prevents us from having 2 different incompatibile version of API in integration tests. So in this PR v1alpha1 is removed until testing infrastructure is fixed.

Base PR comment:

Currently there is a single bool in disruption budget api that denotes whether 1 pod can be deleted or not. Every time a pod is deleted the apiserver filps the bool to false and the disruptionbudget controller sets it to true if more deletions are allowed. This works but it is far from optimal when the user wants to delete multiple pods (for example, by decreasing replicaset size from 10000 to 8000).
This PR adds a new api version v1beta1 and changes bool to int which contains a number of pods that can be deleted at once.

cc: @davidopp @mml @wojtek-t @fgrzadkowski @caesarxuchao
2016-11-03 15:50:19 -07:00
Kubernetes Submit Queue 7c391158e3 Merge pull request #35810 from deads2k/client-18-decode-status
Automatic merge from submit-queue

always allow decoding of status when returned from the API

`unversioned.Status` should be able to come back from any API version and still be properly decoded.  This doesn't happen today by default.

@smarterclayton  Our projectrequest endpoint returns a `Status` object on a 200 return from list to indicate everything went well.  This (or something like it) is needed to make the API accepted by `kubectl`.  Alternatively, we change the API to return a different (still not a `Project`) value from list, which still feels wrong.
2016-11-03 11:18:23 -07:00
Marcin 3872a47074 Autogenerated code and docs 2016-11-03 18:36:32 +01:00
Kubernetes Submit Queue f91cd17821 Merge pull request #35799 from deads2k/client-17-negotiation
Automatic merge from submit-queue

clean up client version negotiation to handle no legacy API

Version negotiation fails if the legacy API endpoint isn't available.

This tightens up the negotiation interface based to more clearly express what each stage is doing and what the constraints on negotiation are.  This is needed to speak to generic API servers.

@kubernetes/kubectl
2016-11-03 07:53:47 -07:00
Janet Kuo c25455e8b3 (Auto-gen) Run hack/update-all & update-bazel & update linted packages 2016-11-02 15:16:41 -07:00
Janet Kuo c15b9470f5 Replace apps/v1alpha1 with apps/v1beta1 and manually remove generated apps/v1alpha1 files
Manually remove generated apps/v1alpha1 types, protobuf, and api-reference doc files
Manually remove apps/v1alpha1 folder from 1.5 generated client
2016-11-02 15:16:23 -07:00
Kubernetes Submit Queue 7d14b568c3 Merge pull request #36001 from smarterclayton/change_double_decode
Automatic merge from submit-queue

Avoid double decoding all client responses

Fixes #35982 

The linked issue uncovered that we were always double decoding the response in restclient for get, list, update, create, and patch.  That's fairly expensive, most especially for list.  This PR refines the behavior of the rest client to avoid double decoding, and does so while minimizing the changes to rest client consumers.

restclient must be able to deal with multiple types of servers. Alter the behavior of restclient.Result#Raw() to not process the body on error, but instead to return the generic error (which still matches the error checking cases in api/error like IsBadRequest). If the caller uses
.Error(), .Into(), or .Get(), try decoding the body as a Status.

For older servers, continue to default apiVersion "v1" when calling restclient.Result#Error(). This was only for 1.1 servers and the extensions group, which we have since fixed.

This removes a double decode of very large objects (like LIST) - we were trying to DecodeInto status, but that ends up decoding the entire result and then throwing it away.  This makes the decode behavior specific to the type of action the user wants.

```release-note
The error handling behavior of `pkg/client/restclient.Result` has changed.  Calls to `Result.Raw()` will no longer parse the body, although they will still return errors that react to `pkg/api/errors.Is*()` as in previous releases.  Callers of `Get()` and `Into()` will continue to receive errors that are parsed from the body if the kind and apiVersion of the body match the `Status` object.

This more closely aligns rest client as a generic RESTful client, while preserving the special Kube API extended error handling for the `Get` and `Into` methods (which most Kube clients use).
```
2016-11-02 11:36:41 -07:00
Chao Xu ca70b19554 run update-bazel.sh 2016-11-01 23:33:23 -07:00
Chao Xu 36f11c4b21 copy missing expansion files to release_1_5 2016-11-01 23:32:40 -07:00
Clayton Coleman ce187f9c6a
Avoid double decoding all client responses
restclient must be able to deal with multiple types of servers. Alter
the behavior of restclient.Result#Raw() to not process the body on
error, but instead to return the generic error (which still matches the
error checking cases in api/error like IsBadRequest). If the caller uses
.Error(), .Into(), or .Get(), try decoding the body as a Status.

For older servers, continue to default apiVersion "v1" when calling
restclient.Result#Error(). This was only for 1.1 servers and the
extensions group, which we have since fixed.

This removes a double decode of very large objects (like LIST).
2016-11-01 22:55:51 -04:00
Mike Danese bdcb4a9784 remove orphaned build file 2016-11-01 15:13:40 -07:00
Mike Danese 1c89526963 autogenerated 2016-11-01 15:13:27 -07:00
deads2k 235678d591 always allow decoding of status when returned from the API 2016-11-01 16:36:45 -04:00
Kubernetes Submit Queue 1fa8369074 Merge pull request #35639 from ncdc/lister-gen
Automatic merge from submit-queue

Add tooling to generate listers

Add lister-gen tool to auto-generate listers. So far this PR only demonstrates replacing the manually-written `StoreToLimitRangeLister` with the generated `LimitRangeLister`, as it's a small and easy swap.

cc @deads2k @liggitt @sttts @nikhiljindal @lavalamp @smarterclayton @derekwaynecarr  @kubernetes/sig-api-machinery @kubernetes/rh-cluster-infra
2016-11-01 09:29:06 -07:00
Chao Xu 4cf7adf937 remove release_1_4
remove archived federation clientsets
update README
2016-10-31 15:05:26 -07:00
deads2k bae940df5c clean up client version negotiation to handle no legacy API 2016-10-31 16:05:50 -04:00
Andy Goldstein 13abf36c60 Update bazel build files 2016-10-31 11:13:44 -04:00
Andy Goldstein 7b85985a72 Add generated listers 2016-10-31 11:13:43 -04:00
Chao Xu 2044927034 move watch.ListWatchUntil to its own package to avoid future import cycle 2016-10-30 13:14:20 -07:00
Kubernetes Submit Queue a06a08a906 Merge pull request #34489 from caesarxuchao/time-copy.sh
Automatic merge from submit-queue

Verify and update client-go staging area for every PR

We need to keep the staging area up-to-date to prevent PRs from breaking client-go.

It's marked as "WIP" because we need to decide the [versioning strategy](https://github.com/kubernetes/client-go/issues/9) for client-go first. This PR contains breaking changes for client-go.

This is blocking #29934 and potentially #34441

cc @kubernetes/sig-api-machinery
2016-10-29 16:24:07 -07:00
Chao Xu fd2fdfba89 move client/unversioned/fake to client/restclient/fake 2016-10-29 14:22:02 -07:00
Chao Xu 850729bfaf include multiple versions in clientset
update client-gen to use the term "internalversion" rather than "unversioned";
leave internal one unqualified;
cleanup client-gen
2016-10-29 13:30:47 -07:00
Kubernetes Submit Queue 620788a795 Merge pull request #35230 from deads2k/controller-12-sa-controller
Automatic merge from submit-queue

convert SA controller to shared informers

convert the SA controller to shared informer + workqueue.

I think one of @derekwaynecarr @ncdc or @liggitt
2016-10-29 10:09:46 -07:00
Kubernetes Submit Queue 17e4156163 Merge pull request #35785 from piosz/clientset
Automatic merge from submit-queue

Removed 1.3 clientset

needed for #35782
2016-10-29 08:37:04 -07:00
Clayton Coleman ca2f1b87ad
Replace negotiation with a new method that can extract info
Alter how runtime.SerializeInfo is represented to simplify negotiation
and reduce the need to allocate during negotiation. Simplify the dynamic
client's logic around negotiating type. Add more tests for media type
handling where necessary.
2016-10-28 11:30:11 -04:00
Piotr Szczesniak 0c4fc2abbf Removed 1.3 clientset 2016-10-28 14:40:47 +02:00
Janet Kuo 3febdb7f71 Remove petset from 1.4 generated client to pass import-boss verification 2016-10-27 17:25:10 -07:00
Janet Kuo 74dbfdca97 (Auto-gen) Run update-all.sh, codecgen, munge docs, and bazel 2016-10-27 17:25:10 -07:00
Janet Kuo f35a095b50 Manually remove previously generated petset client 2016-10-27 17:25:10 -07:00
Janet Kuo e9927664cf Remove unnecessary dependency in client-gen 2016-10-27 17:25:10 -07:00
Janet Kuo 10aee82ae3 Rename PetSet API to StatefulSet 2016-10-27 17:25:10 -07:00
deads2k df4ed892c4 convert SA controller to shared informers 2016-10-27 15:44:46 -04:00
Kubernetes Submit Queue 5423eaf431 Merge pull request #35431 from deads2k/client-16-remove-old
Automatic merge from submit-queue

remove the non-generated client

Removes the non-generated client from kube.  The package has a few methods left, but nothing that needs updating when adding new groups.

@ingvagabund
2016-10-27 05:12:33 -07:00
deads2k 81ae13084d handle non-generated client removal 2016-10-26 16:10:41 -04:00
deads2k 969e945a9e delete non-generated client 2016-10-26 15:14:41 -04:00
Madhusudan.C.S 63e317598c Make the fake RESTClient usable by all the API groups, not just core. 2016-10-26 00:21:23 -07:00
Kubernetes Submit Queue 5ec053719f Merge pull request #35563 from mikedanese/old-clients
Automatic merge from submit-queue

remove old clients from build

<!--  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**:

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

**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-10-25 17:40:38 -07:00
Mike Danese 1682b81295 remove old clients from build 2016-10-25 16:43:19 -07:00
Tim St. Clair 52ed57ec3b
Refactor PortForward server methods into the portforward package 2016-10-25 12:08:35 -07:00
Mike Danese 763c4987f2 autogenerated 2016-10-24 14:47:27 -07:00
Kubernetes Submit Queue 1569a8b04f Merge pull request #35322 from deads2k/controller-14-panic
Automatic merge from submit-queue

prevent panic if resourceversion checked early

Found panic while trying to use this in a separate API server.
2016-10-24 13:38:39 -07:00
deads2k fd65bc8fff prevent panic if resourceversion checked early 2016-10-24 08:25:11 -04:00
Jan Chaloupka 4fde09d308 Replace client with clientset in code 2016-10-23 22:00:35 +02:00
Mike Danese df713b478c fix tests by declaring testdata 2016-10-21 17:32:32 -07:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Kubernetes Submit Queue a7807eb5a4 Merge pull request #34138 from ingvagabund/create-restclient-interface
Automatic merge from submit-queue

Create restclient interface

Refactoring of code to allow replace *restclient.RESTClient with any RESTClient implementation that implements restclient.RESTClientInterface interface.
2016-10-21 16:02:04 -07:00
deads2k a0a0e61f62 add generic shared informer backed by existing informer 2016-10-21 08:39:09 -04:00
Jan Chaloupka 6079053407 Update clientset generator to use RESTClient interface instead of the RESTClient data type 2016-10-21 10:13:51 +02:00
Kubernetes Submit Queue 71471c2330 Merge pull request #34740 from derekwaynecarr/storage-class-informer
Automatic merge from submit-queue

Add an informer for StorageClass

Add an informer for `StorageClass` for later consumption in quota.

/cc @eparis @deads2k @erinboyd
2016-10-20 23:36:58 -07:00
Kubernetes Submit Queue 6306ab00d2 Merge pull request #34845 from derekwaynecarr/make_pvc_informer_list
Automatic merge from submit-queue

PVC informer lister supports listing

This will be used in follow-on PRs for quota evaluation backed by informers for pvcs.

/cc @deads2k @eparis @kubernetes/sig-storage
2016-10-19 19:29:02 -07:00
Chao Xu 45432750df add import restriction to clientset 2016-10-19 11:47:51 -07:00
derekwaynecarr 39da9d19f0 Add an informer for StorageClass 2016-10-19 12:26:57 -04:00
Clayton Coleman 1694cfb72d
Make defaulting part of versioning codec
Most normal codec use should perform defaulting. DirectCodecs should not
perform defaulting. Update the defaulting_test to fuzz the list of known
defaulters. Use the new versioning.NewDefaultingCodec() method.
2016-10-18 21:07:35 -04:00
Kubernetes Submit Queue a31482207f Merge pull request #34960 from sdminonne/serviceaccount_informer
Automatic merge from submit-queue

To add service account informer

@deads2k  this PR adds ServiceAccount informer as discussed [here](https://github.com/openshift/origin/pull/11330#issuecomment-253216303)
2016-10-18 16:21:41 -07:00
Kubernetes Submit Queue 4b7024efe7 Merge pull request #27784 from deads2k/catch-mutators
Automatic merge from submit-queue

add optional mutation checks for shared informer cache

We need to make sure that no one is mutating caches if they're using a shared informer.  It is important that whatever is tracking those changes gets the object *before* anyone else possibly could.

This adds the ability to track the original objects in the cache and their current values.  Go doesn't have an exit hook or a way to say "wait for non-daemon go-funcs to complete before exit", so this runs a gofunc on a loop that can panic the entire process.  It's gated behind an env var.

@derekwaynecarr did I get the right spots to make sure that e2e runs with this flag?
@smarterclayton @kubernetes/rh-cluster-infra
2016-10-18 14:38:57 -07:00
derekwaynecarr 555231fad7 PVC informer lister supports listing 2016-10-18 14:36:33 -04:00
Kubernetes Submit Queue b77e13444f Merge pull request #34939 from wojtek-t/throttle_retried_requests
Automatic merge from submit-queue

Throttle retried requests in client

Fix #34938
2016-10-18 10:08:53 -07:00
deads2k aee54ae57e add optional mutation checks for shared informer cache 2016-10-18 09:19:38 -04:00
Kubernetes Submit Queue e6cc8ff149 Merge pull request #34498 from mml/remotecommand-golint
Automatic merge from submit-queue

Fix lint error in remotecommand.go

Before:

```
pkg/client/unversioned/remotecommand/remotecommand.go:101:9: should omit type http.RoundTripper from declaration of var rt; it will be inferred from the right-hand side

Please fix the above errors. You can test via "golint" and commit the result.
```
2016-10-18 03:35:21 -07:00
Salvatore Dario Minonne a745872b94 To add service account informer 2016-10-18 09:24:54 +02:00
Kubernetes Submit Queue 7414cafbeb Merge pull request #34860 from mbohlool/optional
Automatic merge from submit-queue

+optional tag for OpenAPI spec

OpenAPI rely on "omitempty" json tag to determine if a field is optional or not. This change will add "+optional" tag to all fields with "omitempty" json tag and support the tag in OpenAPI spec generator.
2016-10-17 22:07:00 -07:00
Matt Liggett 805a740d64 Fix lint error in remotecommand.go
Before:

pkg/client/unversioned/remotecommand/remotecommand.go:101:9: should omit type http.RoundTripper from declaration of var rt; it will be inferred from the right-hand side

Please fix the above errors. You can test via "golint" and commit the result.
2016-10-17 17:26:27 -07:00
derekwaynecarr 3c0b35d6b1 Add LimitRange informer 2016-10-17 16:00:26 -04:00
mbohlool 25afcc5522 Add +optional tag to all fields with omitempty json tag 2016-10-17 08:52:13 -07:00
Wojciech Tyczynski 564fc0cc80 Throttle retried requests in client 2016-10-17 11:45:35 +02:00
Kubernetes Submit Queue 13196527cf Merge pull request #34759 from caesarxuchao/remove-unversioned
Automatic merge from submit-queue

Remove imports of "pkg/client/unversioned" in "pkg/controller"

We are trying to deprecate "pkg/client/unversioned", see https://github.com/kubernetes/kubernetes/issues/25442.

Also part of https://github.com/kubernetes/kubernetes/issues/29934.
2016-10-15 00:10:15 -07:00
Kubernetes Submit Queue c0bd6e8ea5 Merge pull request #33958 from juanvallejo/jvallejo/add-global-timeout-flag
Automatic merge from submit-queue

Add global timeout flag

**Release note**:
```release-note
Add a new global option "--request-timeout" to the `kubectl` client
```

UPSTREAM: https://github.com/kubernetes/client-go/pull/10

This patch adds a global timeout flag (viewable with `kubectl -h`) with
a default value of `0s` (meaning no timeout).

The timeout value is added to the default http client, so that zero
values and default behavior are enforced by the client.

Adding a global timeout ensures that user-made scripts won't hang for an
indefinite amount of time while performing remote calls (right now, remote
calls are re-tried up to 10 times when each attempt fails, however, there is
no option to set a timeout in order to prevent any of these 10 attempts from
hanging indefinitely).

**Example**
```
$ kubectl get pods # no timeout flag set - default to 0s (which means no
timeout)
NAME                      READY     STATUS    RESTARTS   AGE
docker-registry-1-h7etw   1/1       Running   1          2h
router-1-uv0f9            1/1       Running   1          2h

$ kubectl get pods --request-timeout=0 # zero means no timeout no timeout flag set
NAME                      READY     STATUS    RESTARTS   AGE
docker-registry-1-h7etw   1/1       Running   1          2h
router-1-uv0f9            1/1       Running   1          2h

$kubectl get pods --request-timeout=1ms
Unable to connect to the server: net/http: request canceled while
waiting for connection (Client.Timeout exceeded while awaiting headers)
```
2016-10-14 23:29:58 -07:00
juanvallejo fd087caadb Add global timeout flag
This patch adds a global timeout flag (viewable with `kubectl -h`) with
a default value of `0s` (meaning no timeout).

The timeout value is added to the default http client, so that zero
values and default behavior are enforced by the client.

**Example**
```
$ kubectl get pods # no timeout flag set - default to 0s (which means no
timeout)
NAME                      READY     STATUS    RESTARTS   AGE
docker-registry-1-h7etw   1/1       Running   1          2h
router-1-uv0f9            1/1       Running   1          2h

$ kubectl get pods --timeout=0 # zero means no timeout no timeout flag set
NAME                      READY     STATUS    RESTARTS   AGE
docker-registry-1-h7etw   1/1       Running   1          2h
router-1-uv0f9            1/1       Running   1          2h

$kubectl get pods --timeout=1ms
Unable to connect to the server: net/http: request canceled while
waiting for connection (Client.Timeout exceeded while awaiting headers)
```
2016-10-14 09:57:40 -04:00
Chao Xu fbd187af45 move the retry util out of pkg/client/unversioned 2016-10-13 16:10:24 -07:00
deads2k 2c4e618be1 add rbac shared informers 2016-10-13 07:50:02 -04:00
deads2k 518d5500c7 remove testapi.Default.GroupVersion 2016-10-07 10:10:54 -04:00
Kubernetes Submit Queue 6d56d0337a Merge pull request #33234 from caesarxuchao/retry-discovery-failure
Automatic merge from submit-queue

Discovery client retry when failed to discovery resrouces

Fix #32308

`ServerPreferredNamespacedResources()` fails if in the middle of its execution, the TPR e2e tests change the supported resources on the API server. This PR let the e2e test framework retry `ServerPreferredNamespacedResources()`.

cc @lavalamp
2016-10-07 05:13:21 -07:00
Kubernetes Submit Queue a89e4785ba Merge pull request #31949 from asalkeld/fix-coverage
Automatic merge from submit-queue

Ignore troublesome paths that cause coverage to fail

**What this PR does / why we need it**:
`KUBE_COVER=y make check` currently fails, this patch fixes it.

**Which issue this PR fixes** 
fixes #31691

**Special notes for your reviewer**:
None

**Release note**:

```release-note
NONE
```

This avoids the whole command failing because of errors like the following:
```
# cover k8s.io/kubernetes/pkg/client/restclient
cover: internal error: block 268 overlaps block 270
```
2016-10-07 02:40:07 -07:00
Kubernetes Submit Queue 83921597ef Merge pull request #29236 from juanvallejo/jvallejo_add-configuration-missing-error-type
Automatic merge from submit-queue

Update client config invalid option errors to be more specific

This patch adds better error handling for cases where a global option (such as --context or --cluster) causes an invalid config to be returned.

```release-note
release-note-none
```
2016-10-07 01:24:49 -07:00
juanvallejo 6f925b1f82
handle invalid client config option errors
This patch provides a more relevant error message when a client
configuration option is passed with an invalid or non-existent value.

`$ kubectl get pods --cluster="non-existent"`
```
error: No configuration file found, please login or point to an existing
file
```

`$ kubectl get pods --cluster="non-existent"`
```
error: cluster "non-existent" does not exist
```
2016-10-06 16:28:51 -04:00
Kubernetes Submit Queue 42e5f95a6b Merge pull request #34024 from deads2k/controller-06-deployment-controller
Automatic merge from submit-queue

update deployment and replicaset listers

Updates the deployment lister to avoid copies and updates the deployment controller to use shared informers.

Pushing WIP to see which tests are broken.
2016-10-06 00:02:34 -07:00
deads2k c30b2efc46 update replicaset lister 2016-10-05 15:20:27 -04:00
deads2k 358a57d74a update deployment lister 2016-10-05 13:27:35 -04:00
deads2k 8ea2acc6a3 use service accounts as clients for controllers 2016-10-05 13:15:16 -04:00
Kubernetes Submit Queue 0798f02391 Merge pull request #33942 from kargakis/sttts-kubectl-run-watch-until
Automatic merge from submit-queue

Switch kubectl to use watch.Until

Squashed version of https://github.com/kubernetes/kubernetes/pull/30235 

@ncdc PTAL

cc: @kubernetes/kubectl
2016-10-05 08:29:54 -07:00
Wojciech Tyczynski c215bd0eac Fix call to Index call in listers 2016-10-05 14:23:31 +02:00
Chao Xu 04ac4a4020 discovery client retry serverPreferredResources() in case groups changed in the middle 2016-10-04 21:49:53 -07:00
Chao Xu a3861b9cb9 generated 2016-10-04 20:39:29 -07:00
Chao Xu 75cc05de82 manual changes to let client-gen use versioned options 2016-10-04 20:39:29 -07:00
Kubernetes Submit Queue dab787d80d Merge pull request #31755 from smarterclayton/has_synced
Automatic merge from submit-queue

DeltaFIFO should not report HasSynced until deletes are reported

Deletions identified by knownObjects on the initial sync replace
(immediately after the List from a reflector) should be considered part
of the initial sync since we have the information available at the time
we do the deletion.

An error during Replace() can result in Populated not being set, but it
was incorrect before (population would be wrong) and queueActionLocked
does not error except on "my cache is broken because I gave an incorrect
keyFunc".

@lavalamp @deads2k hit this while trying to use DeltaFIFO to implement an "external" controller (one that uses the knownObjects as provided by a call to a remote system of record).

Not 1.4
2016-10-03 15:41:20 -07:00
bindata-mockuser 5ad518cd2b Switch kubectl to use watch.Until 2016-10-03 17:17:41 +02:00
Kubernetes Submit Queue e8ae960af4 Merge pull request #33868 from wongma7/update-1.4-clientset
Automatic merge from submit-queue

Run hack/update-codegen.sh in release-1.4 for generating an updated 1.4 clientset

@caesarxuchao doing steps 1 and 2 as described here https://github.com/kubernetes/kubernetes/pull/33851#issuecomment-250851272

adds apps, authentication, certificates, rbac, and storage.

The reason there are substantial deletions (aside from the oneliner "this package is generated by client-gen with arguments...") is because PR https://github.com/kubernetes/kubernetes/pull/32407 added a resource to the 1.4 clientset even though the resource is not present in 1.4 and the PR is targeted to 1.5. So this corrects that, as a bonus.
2016-10-01 07:01:15 -07:00
Matthew Wong 014239f06b Run hack/update-codegen.sh in release-1.4 2016-09-30 18:21:55 -04:00
Timothy St. Clair 4a9f72b59f Abstraction of endpoints in leaderelection code 2016-09-29 23:42:00 -05:00
Wojciech Tyczynski df8f83fd51 Use multiple clients in load test to avoid "no cached connections" errors. 2016-09-29 16:32:57 +02:00
Kubernetes Submit Queue 4bda90e89c Merge pull request #33645 from kargakis/remove-obsolete-pkg-name
Automatic merge from submit-queue

cache: remove obsolete internal package name

pkg/controller/framework is not a thing since https://github.com/kubernetes/kubernetes/pull/32718

@mikedanese @wojtek-t
2016-09-28 06:55:53 -07:00
Kubernetes Submit Queue dc06ceb87d Merge pull request #32246 from caesarxuchao/fed-1.5
Automatic merge from submit-queue

Update federation controllers to use release 1.5 clientset

This PR is based on #32243, we won't merge it until next week, to make cherry-picks easier.
2016-09-28 04:17:20 -07:00
Michail Kargakis 78dfe52afb cache: remove obsolete internal package name 2016-09-28 11:35:48 +02:00
Kubernetes Submit Queue b2c175c758 Merge pull request #33474 from wojtek-t/user_agent_for_master_election
Automatic merge from submit-queue

Set UserAgent in LeaderElection clients.

Ref https://github.com/kubernetes/kubernetes/issues/33259

@timothysc - FYI
2016-09-27 22:58:08 -07:00
Chao Xu a780db9a03 changes in federation controllers 2016-09-27 14:33:24 -07:00
Clayton Coleman bbd8096065
DeltaFIFO should not report HasSynced until deletes are reported
Deletions identified by knownObjects on the initial sync replace
(immediately after the List from a reflector) should be considered part
of the initial sync since we have the information available at the time
we do the deletion.

An error during Replace() can result in Populated not being set, but it
was incorrect before (population would be wrong) and queueActionLocked
does not error except on "my cache is broken because I gave an incorrect
keyFunc".
2016-09-27 12:56:17 -04:00
Wojciech Tyczynski cbcce2c90f Set UserAgent in LeaderElection clients. 2016-09-27 15:22:40 +02:00
Kubernetes Submit Queue 1e7fa1f6cd Merge pull request #33334 from caesarxuchao/copy-auth-plugin
Automatic merge from submit-queue

Copy auth plugin to client-go repo

client-go doesn't copy the [auth plugin](https://github.com/kubernetes/kubernetes/blob/master/plugin/pkg/client/auth/plugins.go). This causes user cannot access cluster run by GKE. User will see error "No Auth Provider found for name gcp".

This PR fixes this issue. It's marked as WIP because I'll need to rebase after #32906 gets merged. Also, the fix needs to be cherry-picked into 1.4 branch to update client-go/1.4.
2016-09-27 02:30:38 -07:00
Kubernetes Submit Queue 224a16f0ea Merge pull request #33273 from guangxuli/k8s_0922_02
Automatic merge from submit-queue

test file should be remove after test over
2016-09-26 22:29:57 -07:00
guangxuli f2f591aa45 test file should be remove after test over
remove the tmp file

gofmt
2016-09-27 11:56:45 +08:00
Chao Xu a397e306a4 run client-gen
run copy.sh
2016-09-26 15:40:36 -07:00
Chao Xu e17e0b19ab remove special clientrepo code from main repository gcp plugin
rename plugin/pkg/client/auth/plugins.go package name to auth

add the plugin import line in client-gen

update import_known_versions for release_1_5 clientset

change copy.sh
2016-09-26 15:40:29 -07:00
deads2k 48ac4d549d change e2e scale to avoid adapter 2016-09-26 07:58:01 -04:00
Kubernetes Submit Queue 64777d37b6 Merge pull request #33268 from deads2k/client-14-rc-svc-lister
Automatic merge from submit-queue

simplify RC listers

Make the RC and SVC listers use the common list functions that more closely match client APIs, are consistent with other listers, and avoid unnecessary copies.
2016-09-23 23:37:15 -07:00
Kubernetes Submit Queue 071927a59d Merge pull request #32549 from smarterclayton/gc_non_kube_legacy
Automatic merge from submit-queue

Allow garbage collection to work against different API prefixes

The GC needs to build clients based only on Resource or Kind. Hoist the
restmapper out of the controller and the clientpool, support a new
ClientForGroupVersionKind and ClientForGroupVersionResource, and use the
appropriate one in both places.

Allows OpenShift to use the GC
2016-09-23 14:06:35 -07:00
Kubernetes Submit Queue 5f815354e0 Merge pull request #33182 from deads2k/api-13-collapse-script-references
Automatic merge from submit-queue

unify available api group versions in our scripts

There are currently many parallel lists of available group versions with slightly different syntaxes in each one.  This collapses them into a single list for us to maintain.  

Also caught spots where the lists didn't match before.

@sttts @ncdc
2016-09-23 10:06:10 -07:00
deads2k 500959b70c fix RC lister 2016-09-23 08:12:03 -04:00
Kubernetes Submit Queue b2aed32578 Merge pull request #33269 from deads2k/client-15-svc-lister
Automatic merge from submit-queue

simplify svc lister

trying to track down what killed the e2e tests.
2016-09-23 03:10:57 -07:00
Kubernetes Submit Queue 1ef86aa8ab Merge pull request #32906 from caesarxuchao/staging-1.5
Automatic merge from submit-queue

Staging 1.5 client

Created the 1.5 folder and remove the 1.4 folder in the staging area in the master branch.

Content of kubernetes/client-go/1.4 will be pulled from the kubernetes/kubernetes 1.4 branch (https://github.com/kubernetes/contrib/pull/1719)
2016-09-22 19:55:01 -07:00
Clayton Coleman 97c35fcc67
Allow garbage collection to work against different API prefixes
The GC needs to build clients based only on Resource or Kind. Hoist the
restmapper out of the controller and the clientpool, support a new
ClientForGroupVersionKind and ClientForGroupVersionResource, and use the
appropriate one in both places.
2016-09-22 15:00:58 -04:00
Kubernetes Submit Queue 4ab5a76338 Merge pull request #33103 from deads2k/controller-03-kill-non-generatedclient
Automatic merge from submit-queue

switch controller manager to generated clients

Switches the controller manager to generated clients.

@ncdc ptal
2016-09-22 11:37:01 -07:00
deads2k 43db7c0c44 generated code that was missing before 2016-09-22 13:30:42 -04:00
deads2k 483af28944 fix up service lister 2016-09-22 09:12:37 -04:00
Kubernetes Submit Queue 5af04d1dd1 Merge pull request #32876 from errordeveloper/more-cert-utils
Automatic merge from submit-queue

Refactor cert utils into one pkg, add funcs from bootkube for kubeadm to use

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

We have ended-up with rather incomplete and fragmented collection of utils for handling certificates. It may be worse to consider using `cfssl` for doing all of these things, but for now there is some functionality that we need in `kubeadm` that we can borrow from bootkube. It makes sense to move the utils from bookube into core, as discussed in #31221.

**Special notes for your reviewer**: I've taken the opportunity to review names of existing funcs and tried to make some improvements in that area (with help from @peterbourgon).

**Release note**:

```release-note
NONE
```
2016-09-22 01:29:46 -07:00
Antoine Pelisse 938872582e Revert "simplify RC and SVC listers" 2016-09-21 15:49:38 -07:00
Chao Xu a4e62297d6 fix tests 2016-09-21 14:44:39 -07:00