-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix(server): Re-establish watch on v1.Status errors. Fixes #3608 #3609
Conversation
case event, ok := <-watch.ResultChan(): | ||
var wf *wfv1.Workflow | ||
if ok { | ||
wf, ok = event.Object.(*wfv1.Workflow) | ||
} | ||
if !ok { |
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.
Could you explain this? Not sure how this fixes the issue?
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.
essentially, I'm assuming if the result channel is closed, or the object is not an workflow (I'm assuming that this is a *api.Status
error), but I don't think we care what it is, we just want to re-establish:
type Event struct {
Type EventType
// Object is:
// * If Type is Added or Modified: the new state of the object.
// * If Type is Deleted: the state of the object immediately before deletion.
// * If Type is Bookmark: the object (instance of a type being watched) where
// only ResourceVersion field is set. On successful restart of watch from a
// bookmark resourceVersion, client is guaranteed to not get repeat event
// nor miss any events.
// * If Type is Error: *api.Status is recommended; other types may make sense
// depending on context.
Object runtime.Object
}
Checklist:
"fix(controller): Updates such and such. Fixes #1234"
.Fixes #3608