Save marshalled empty response in streaming service#8667
Save marshalled empty response in streaming service#8667estesp merged 1 commit intocontainerd:mainfrom
Conversation
|
Skipping CI for Draft Pull Request. |
32fc053 to
1273311
Compare
|
cc @dmcgowan PTAL thanks! |
I think this is more concise In addition, the initialization of emptyResponse is not actually related to InitFn, so it looks fine to put it directly in init, eg var emptyResponse typeurl.Any
func init () {
emptyResponse, err = typeurl.MarshalAny(&ptypes.Empty{})
if err != nil {
panic(fmt.Sprintf("......: %v", err))
}
plugin.Register(&plugin.Registration{
....
} |
1273311 to
2abc7b6
Compare
Signed-off-by: Jin Dong <[email protected]>
2abc7b6 to
e26c97c
Compare
updated. thanks for the reminder :). I didn't use this approach because not sure if it's okay to panic in plugin init 😅 |
T functions such as |
|
I'd argue if it did panic we likely screwed up typeurl pretty bad 😆. I like @Iceber's suggestion |
…/main Merge upstream containerd/main at commit 5d1ab01 into ado fork-external/main Related work items: containerd#7944, containerd#8174, containerd#8334, containerd#8362, containerd#8572, containerd#8582, containerd#8588, containerd#8605, containerd#8606, containerd#8617, containerd#8619, containerd#8626, containerd#8627, containerd#8633, containerd#8637, containerd#8641, containerd#8643, containerd#8645, containerd#8652, containerd#8667, containerd#8672, containerd#8673, containerd#8676, containerd#8680, containerd#8684, containerd#8685, containerd#8692, containerd#8696, containerd#8697, containerd#8701, containerd#8708, containerd#8717, containerd#8726, containerd#8728, containerd#8729, containerd#8731, containerd#8732, containerd#8740, containerd#8752, containerd#8758, containerd#8762, containerd#8764
Use a
*typeurl.Anyand nil pointer to indicate if the marshal result is saved.Another approach might be just marshal the empty response as part of
InitFn? 🤔️