Skip to content

Commit

Permalink
podresources: watch: fix WatchPodResourcesResponse
Browse files Browse the repository at this point in the history
Per comments during the review of the Watch endpoint proposal:
1. kubernetes#1926 (comment)
2. kubernetes#1926 (review)

The agreed semantic of a Watch() response message
a. refers to a single pod. The intention was always to stream only individual pod changes
   (kubernetes#1926 (comment))
b. must allow the client to reconcile with the response of the List()
   endpoint, thus must include a pod resource version.

This patch thus adds the missing resource version field and removes the
`repeated` attribute to the `PodResources` field.
Removing `repeated` is the simplest possible change that aligns the
proposal to the intention.

Alternatively, it is possible to change the proto so we can allow a
`WarchPodResourcesResponse` object to convey information about more
pods; however the performance and UX benefits of this more invasive
change are unclear, so we avoid it at this moment.

This change was missing because it was lost in a rebase

Signed-off-by: Francesco Romani <fromani@redhat.com>
  • Loading branch information
ffromani committed Oct 23, 2020
1 parent b6b005f commit 39bec20
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ enum WatchPodAction {
message WatchPodResourcesResponse {
WatchPodAction action = 1;
string uid = 2;
repeated PodResources pod_resources = 3;
int64 resource_version = 3;
PodResources pod_resources = 4;
}
// PodResources contains information about the node resources assigned to a pod
Expand Down

0 comments on commit 39bec20

Please sign in to comment.