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 #4496: removing list handling from watching #4506
Conversation
// when watching API Groups we don't get a WatchEvent resource | ||
// so the object will be null | ||
// so lets try parse the message as a KubernetesResource | ||
// as it will probably be a list of resources like a BuildList | ||
if (object == null) { | ||
object = Serialization.unmarshal(messageSource, KubernetesResource.class); | ||
if (event == null) { | ||
event = new WatchEvent(object, "MODIFIED"); | ||
} else { | ||
event.setObject(object); | ||
} | ||
} |
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.
What happens if you watch API Groups in a real cluster?
From yesterday's discussion, the assumption was that receiving a list as an event was not possible, but the former comment here says otherwise.
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.
What happens if you watch API Groups in a real cluster?
I couldn't quite determine what that comment meant. You cannot watch APIGroup directly, and we have no example, including Builds, where a watch returns a list rather than a WatchEvent. My only guess is that this was from early behavior in OpenShift and the comment could be referencing not using oapi for the watch.
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.
OK, I recall now you did provide that explanation.
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, thx!
Kudos, SonarCloud Quality Gate passed! |
Description
fix #4496 removing list handling from the abstract watch manager.
Type of change
test, version modification, documentation, etc.)
Checklist