Return error from watcher
when kinds do not support watch
#1101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A quick fix for #1092. This should just cause the watcher to spin infinitely (like in the case where the crd isn't installed and people try to watch there). It's not 100% ideal, as an explicit crash might be better for many users to be seen early.
This PR avoids crashing user code without their knowledge (something users generally hate), but it will also potentially not work, get successfully deployed (replacing an older version in a rolling upgrade due to no crashloop), but will just spin-error continuously without actually doing anything. Then again, it's not like an earlier version will have worked with watch, because if a resource does not support watch, it did not support watch before we started error handling.
Passing an error here does give the whole system a (slim) chance to fix itself if a simultaneous upgrade to a resource (adding watch support for the resource) gets deployed. So it's in-line with standard "eventual consistency" ideals. The spin-lock problem is also somewhat mitigated with backoff support.