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:
Clayton Coleman
2015-03-24 00:07:22 -04:00
parent 1618c39a46
commit eb0eff69fe
11 changed files with 116 additions and 176 deletions

View File

@@ -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)