Remove embedded WriteEvent from WrittenEvent struct, to avoid having unnecessary fields. (#101081)

This commit is contained in:
Peter Štibraný
2025-02-20 17:34:25 +01:00
committed by GitHub
parent 6e5de80ef2
commit b4c4b9abbd
4 changed files with 27 additions and 16 deletions
+8 -10
View File
@@ -851,17 +851,15 @@ func (b *backend) poll(ctx context.Context, grp string, res string, since int64,
prevRV = new(int64)
}
stream <- &resource.WrittenEvent{
WriteEvent: resource.WriteEvent{
Value: rec.Value,
Key: &resource.ResourceKey{
Namespace: rec.Key.Namespace,
Group: rec.Key.Group,
Resource: rec.Key.Resource,
Name: rec.Key.Name,
},
Type: resource.WatchEvent_Type(rec.Action),
PreviousRV: *prevRV,
Value: rec.Value,
Key: &resource.ResourceKey{
Namespace: rec.Key.Namespace,
Group: rec.Key.Group,
Resource: rec.Key.Resource,
Name: rec.Key.Name,
},
Type: resource.WatchEvent_Type(rec.Action),
PreviousRV: *prevRV,
Folder: rec.Folder,
ResourceVersion: rec.ResourceVersion,
// Timestamp: , // TODO: add timestamp