-
Notifications
You must be signed in to change notification settings - Fork 904
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
feat: Implement watch for Istio resources #354
Conversation
Codecov Report
@@ Coverage Diff @@
## master #354 +/- ##
==========================================
- Coverage 83.97% 83.75% -0.23%
==========================================
Files 70 70
Lines 6528 6593 +65
==========================================
+ Hits 5482 5522 +40
- Misses 750 774 +24
- Partials 296 297 +1
Continue to review full report at Codecov.
|
046e271
to
62a8a5b
Compare
62a8a5b
to
ceab1e0
Compare
3d72488
to
f6c7d97
Compare
f6c7d97
to
4592a97
Compare
for watchEvent := range watchI.ResultChan() { | ||
processNextWatchObj(watchEvent, queue, indexer, index) | ||
} | ||
return nil |
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.
There should be a watchI.Stop()
call which will clean up resources held by the watch.
} | ||
err := WatchResource(client, namespace, gvk, queue, indexer, index) | ||
if err == nil { | ||
continue |
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.
Minor, but If there is no error, I would suggest that we "reset" the exponential backoff by re-initializing the backoff variable.
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.
Minor comments to ensure we call the .Stop() and to reset exponential backoff if we get a happy path.
acc, err := meta.Accessor(obj) | ||
if err != nil { | ||
log.Errorf("Error processing object from watch: %v", err) | ||
return |
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.
Is there a reason you don't surface these errors to the caller? I'm afraid that we might get into an error hotloop which we will not back off from with the exponential backoff
Actually, nevermind, we might get here because of normal stream closes, which we would not want to backoff from, and is covered by the closing of the ResultChan()
To ensure the controller maintains the desired state of the virtual service, this PR adds a watch on virtual services and enqueues rollout that reference those virtual services.