mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-16 14:45:28 +00:00
Move watch to being a resthandler resource and expose it on LIST
GET /pods?watch=true&resourceVersion=10 will now function equivalent to GET /watch/pods.
This commit is contained in:
@@ -37,6 +37,11 @@ type watchEvent struct {
|
||||
Object runtime.RawExtension `json:"object,omitempty"`
|
||||
}
|
||||
|
||||
// NewWatchEvent returns the serialization form of watchEvent for structured schemas
|
||||
func NewWatchEvent() interface{} {
|
||||
return &watchEvent{}
|
||||
}
|
||||
|
||||
// Object converts a watch.Event into an appropriately serializable JSON object
|
||||
func Object(codec runtime.Codec, event *watch.Event) (interface{}, error) {
|
||||
obj, ok := event.Object.(runtime.Object)
|
||||
|
Reference in New Issue
Block a user