Commit Graph

42 Commits

Author SHA1 Message Date
Kubernetes Submit Queue
268555a30a
Merge pull request #57504 from yue9944882/fix-fake-client-dummy-watch
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

feat(fakeclient): push event on watched channel on add/update/delete

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

This PR enables watch function for kubernetes [fakeclient](1bcf0b0a22/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go (L88)). 

This fake client add watchReactorFunction by wrapping [watch.NewFake](1bcf0b0a22/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go (L98)) which is a `chan Event` but actually nothing pushes objects into this channel. So all watch function called by fake client will never return or never receive any object. 

This PR intercepts ReactionFunc of `Create / Update / DeleteActionImpl` and will push the requested object to channel. 

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

Fixes #54075

**Special notes for your reviewer**:

**Release note**:

```dev-release-note
enable watch function for fake client
```
2018-01-16 08:39:03 -08:00
yue9944882
6f381ab2cd Regenerating code of fake clientset 2018-01-16 22:11:43 +08:00
Christoph Blecker
80e344644e
Regenerate all generated code 2018-01-02 00:21:07 -08:00
Marek Grabowski
ef6f0b8c6e generated 2017-11-22 18:40:09 +00:00
Lucas Käldström
e1cff67aa6
autogenerated code 2017-08-27 18:32:14 +03:00
Bobby (Babak) Salamat
e827e1ba87 autogenerated files 2017-07-18 17:47:57 -07:00
Dan Winship
0923f860f1 Regenerate files 2017-05-28 10:11:02 -04:00
Chao Xu
bc9b305f17 generated clients 2017-05-26 00:03:53 -07:00
Chao Xu
5f5a70f65f generated clientset changes
propagate to client-go
update-bazel.sh
2017-05-04 11:30:51 -07:00
Jess Frazelle
9b5d1af3ca
run generators and updaters
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-03-01 13:04:29 -08:00
Dr. Stefan Schimanski
fc6d87c0a2 Update client 2017-02-28 15:34:34 +01:00
Dr. Stefan Schimanski
595f4ed2cb Update generated files 2017-02-22 19:03:25 +01: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
deads2k
f1176d9c5c mechanical repercussions 2017-01-13 08:27:14 -05:00
deads2k
6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Jeff Grafton
fae627dd65 Update generated for 2017 2017-01-01 23:11:09 -08: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
deads2k
adda69c7ca generated code 2016-09-20 12:53:46 -04:00
deads2k
11c4de457d generated client code 2016-09-12 07:38:34 -04:00
deads2k
6320dc6e73 generated code for moving StorageClass 2016-09-06 08:41:17 -04:00
deads2k
d9a203409a initial generated code for SAR 2016-08-05 11:37:43 -04:00
deads2k
eb79e2c859 generated code changes 2016-08-03 08:37:45 -04:00
Wojciech Tyczynski
4d0d115690 Revert "add tokenreviews endpoint to implement webhook" 2016-07-21 09:40:35 +02:00
deads2k
bfa2ff00b9 generated code changes 2016-07-20 15:11:56 -04:00
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot
7f3da674f7 Merge pull request #26680 from olegshaldybin/fake-clientset-registry
Automatic merge from submit-queue

Track object modifications in fake clientset

Fake clientset is used by unit tests extensively but it has some
shortcomings:

- no filtering on namespace and name: tests that want to test objects in
  multiple namespaces end up getting all objects from this clientset,
  as it doesn't perform any filtering based on name and namespace;

- updates and deletes don't modify the clientset state, so some tests
  can get unexpected results if they modify/delete objects using the
  clientset;

- it's possible to insert multiple objects with the same
  kind/name/namespace, this leads to confusing behavior, as retrieval is
  based on the insertion order, but anchors on the last added object as
  long as no more objects are added.

This change changes core.ObjectRetriever implementation to track object
adds, updates and deletes.

Some unit tests were depending on the previous (and somewhat incorrect)
behavior. These are fixed in the following few commits.
2016-06-29 06:04:33 -07:00
George Tankersley
c9c6fff269 codegen: GENERATE ALL THE THINGS 2016-06-28 12:05:41 -07:00
Oleg Shaldybin
d445d4082d Regenerate clientsets 2016-06-28 10:59:54 -07:00
Eric Chiang
36ecec58f0 regenerate all 2016-05-25 14:26:09 -07:00
Piotr Szczesniak
800c1a4d36 Auto-generated changes 2016-05-09 09:32:50 +02:00
Maciej Szulik
c470afc206 Generated changes for moving job internals from pkg/apis/extensions to pkg/apis/batch 2016-04-25 11:03:57 +02:00
goltermann
3fa6c6f6d9 Enable vet 2016-04-20 09:48:24 -07:00
Chao Xu
db518cf4ff Generated code 2016-04-06 10:17:48 -07:00
Chao Xu
49559a3332 Generate the typed clients under the clientset folder 2016-03-31 15:28:45 -07:00
Chao Xu
3aa26565fc move fake discovery client to pkg/client/typed/discovery/fake 2016-03-25 16:02:08 -07:00
Chao Xu
ec02dfc9f0 generated changes 2016-03-14 10:28:20 -07:00
Jordan Liggitt
d008283942 Tolerate multiple registered versions in a single group 2016-03-12 12:49:41 -05:00
Kris
dbde4fd798 Move the discovery client to its own package 2016-03-04 13:44:52 -08:00
Abhi Shah
b25a48d605 Revert "Move discovery client to its own package" 2016-03-04 09:24:54 -08:00
Kris
f22664159e Move the discovery client to its own package 2016-02-29 15:37:21 -08:00
Chao Xu
ad46715f51 generate fake client for release_1_2 2016-02-17 16:10:02 -08:00