I am receiving a WatchEvent message and the value stored in this kubernetes
proto is -
1. Type - for ex. event such as modified or added or deleted
2. Object - raw bytes of actual object. Can be any object.
I want to convert those raw bytes to actual objects such as pod. Note that
I know the kind name of that RawExtension runtime object.
Currently I was doing this but result is negative -
if( eventType == "ADDED" || eventType == "MODIFIED" ) { WatchEvent watch;
watch.set_type( eventType ); string object = responseJson["object"].dump();
watch.mutable_object()->set_raw(object); cout << "Message" << endl; cout <<
watch.DebugString() << endl; Pod pod; JsonStringToMessage(
watch.object().raw(), &pod ); cout << "Pod" << endl; cout <<
pod.DebugString() << endl; }
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/protobuf/f3b09158-a2b7-4764-86e9-31c6d8a90936n%40googlegroups.com.