-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Reactor Usage #500
Comments
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle rotten Still awaiting a response here. Thanks. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/reopen |
@antoineco: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I just faced the same issue and was wondering whether this behaviour is by design. The most confusing part is that there doesn't seem to be a way to chain ReactionFuncs, although those functions are stored in a field called @pcj suggests to use Would proposed changes still be considered at this point?
|
as of kubernetes/kubernetes#73601, released in client-go v11.0.0, reactors can mutate an object, then return |
Aha! One can now mutate /close |
@antoineco: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I've been working on this for days...... Thanks ! @pcj |
* Add new step * Add tests * Bump image * Run every make check * Use test values for timeouts * adding code to fix cluster upgrade test * format fix * restore db component removal fix * fine tune too big timeouts * remove log messgaes * correcting provisioner images for tests * provisioning tests enchancements * fix in unit test - change append to prepend see kubernetes/client-go#500 * restore old images of tests * git format Co-authored-by: Przemyslaw Golicz <przemyslaw.golicz@sap.com>
…roject#286) * Add new step * Add tests * Bump image * Run every make check * Use test values for timeouts * adding code to fix cluster upgrade test * format fix * restore db component removal fix * fine tune too big timeouts * remove log messgaes * correcting provisioner images for tests * provisioning tests enchancements * fix in unit test - change append to prepend see kubernetes/client-go#500 * restore old images of tests * git format Co-authored-by: Przemyslaw Golicz <przemyslaw.golicz@sap.com>
…roject#286) * Add new step * Add tests * Bump image * Run every make check * Use test values for timeouts * adding code to fix cluster upgrade test * format fix * restore db component removal fix * fine tune too big timeouts * remove log messgaes * correcting provisioner images for tests * provisioning tests enchancements * fix in unit test - change append to prepend see kubernetes/client-go#500 * restore old images of tests * git format Co-authored-by: Przemyslaw Golicz <przemyslaw.golicz@sap.com>
…roject#286) * Add new step * Add tests * Bump image * Run every make check * Use test values for timeouts * adding code to fix cluster upgrade test * format fix * restore db component removal fix * fine tune too big timeouts * remove log messgaes * correcting provisioner images for tests * provisioning tests enchancements * fix in unit test - change append to prepend see kubernetes/client-go#500 * restore old images of tests * git format Co-authored-by: Przemyslaw Golicz <przemyslaw.golicz@sap.com>
…roject#286) * Add new step * Add tests * Bump image * Run every make check * Use test values for timeouts * adding code to fix cluster upgrade test * format fix * restore db component removal fix * fine tune too big timeouts * remove log messgaes * correcting provisioner images for tests * provisioning tests enchancements * fix in unit test - change append to prepend see kubernetes/client-go#500 * restore old images of tests * git format Co-authored-by: Przemyslaw Golicz <przemyslaw.golicz@sap.com>
…roject#286) * Add new step * Add tests * Bump image * Run every make check * Use test values for timeouts * adding code to fix cluster upgrade test * format fix * restore db component removal fix * fine tune too big timeouts * remove log messgaes * correcting provisioner images for tests * provisioning tests enchancements * fix in unit test - change append to prepend see kubernetes/client-go#500 * restore old images of tests * git format Co-authored-by: Przemyslaw Golicz <przemyslaw.golicz@sap.com>
…roject#286) * Add new step * Add tests * Bump image * Run every make check * Use test values for timeouts * adding code to fix cluster upgrade test * format fix * restore db component removal fix * fine tune too big timeouts * remove log messgaes * correcting provisioner images for tests * provisioning tests enchancements * fix in unit test - change append to prepend see kubernetes/client-go#500 * restore old images of tests * git format Co-authored-by: Przemyslaw Golicz <przemyslaw.golicz@sap.com>
Asking a question and adding reactor example for some future poor schmuck like myself that spent the afternoon trying to figure out why my reactor was not called.
The key is understanding that that most generated / fake clientsets add in a "catch-all" reactor for the
ObjectTracker
that will always terminate the ReactorChain before it gets to yours. So, although you'd think.AddReactor
would work, in practice it's never called.Consider this snippet in which the
ReactorFunc
will never be called:Looking at https://github.com/kubernetes/client-go/blob/master/kubernetes/fake/clientset_generated.go, we see this code:
In the
testing/fake.go
base clientset, one finds theInvokes
function that is called by all the derived fake client implementations:So the first ReactorFunc that handles the action will be called. Since there is always a
*, *
in the front if the reactor chain, any other one added via theAddReactor
function will never be called.The workaround is to use
PrependReactor
instead:My question is, am I doing this wrong? How is the
AddReactor
function ever useful? I would like to write idiomatic tests but unclear on the reactor usage.The text was updated successfully, but these errors were encountered: