-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generalize resource watchers #47561
Generalize resource watchers #47561
Conversation
47236c1
to
50a3ebb
Compare
50a3ebb
to
c26f411
Compare
Friendly ping @fspmarshall @greedy52 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Just one questino on the ReadOnlyXXX
types, are they necessary? They do add some extra maintenance when updating these objects.
I don't really like it either but I don't have many other good ideas. The intent is to try and thwart any modifications to resources during the filter+iteration provided by the resource watcher. Copies of the resources are only made if the filter matches to avoid excessive memory consumption, however, that means callers must be well behaved. |
7f51dcd
to
ca70101
Compare
Consolidate resource watchers into a single watcher that leverages generics. While most of the resource watchers were similar, some resources have some one off functionality. These watchers have not been touched, however, all that could be refactored to use the generic watcher easily were.
ca70101
to
be13733
Compare
@rosstimothy See the table below for backport results.
|
#47561 incorrectly translated the logic on when to call the diff function for resources. The previous logic only called the differ _if_ the resource was not brand new, however, after the conversion to the generic watcher the differ was always called.
#47561 incorrectly translated the logic on when to call the diff function for resources. The previous logic only called the differ _if_ the resource had already been seen before, which guaranteed that both the old and new resource provided to the diff function were not nil. However, after the conversion to the generic watcher the diff function was called for new resources, resulting in a nil value being provided for the old resource and caused a panic. The previous behavior has been restored, and the ProxyWatcher test has been updated to set a diff function to prevent regressions.
#47561 incorrectly translated the logic on when to call the diff function for resources. The previous logic only called the differ _if_ the resource had already been seen before, which guaranteed that both the old and new resource provided to the diff function were not nil. However, after the conversion to the generic watcher the diff function was called for new resources, resulting in a nil value being provided for the old resource and caused a panic. The previous behavior has been restored, and the ProxyWatcher test has been updated to set a diff function to prevent regressions.
#47561 incorrectly translated the logic on when to call the diff function for resources. The previous logic only called the differ _if_ the resource had already been seen before, which guaranteed that both the old and new resource provided to the diff function were not nil. However, after the conversion to the generic watcher the diff function was called for new resources, resulting in a nil value being provided for the old resource and caused a panic. The previous behavior has been restored, and the ProxyWatcher test has been updated to set a diff function to prevent regressions.
#47561 incorrectly translated the logic on when to call the diff function for resources. The previous logic only called the differ _if_ the resource had already been seen before, which guaranteed that both the old and new resource provided to the diff function were not nil. However, after the conversion to the generic watcher the diff function was called for new resources, resulting in a nil value being provided for the old resource and caused a panic. The previous behavior has been restored, and the ProxyWatcher test has been updated to set a diff function to prevent regressions.
Consolidate resource watchers into a single watcher that leverages generics. While most of the resource watchers were similar, some resources have some one off functionality. These watchers have not been touched, however, all that could be refactored to use the generic watcher easily were.