mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-19 01:12:53 +00:00
add watch bookmark
Kubernetes-commit: d70edd3d39d4430d71c4b7c9adba8df5ba7f16c8
This commit is contained in:
committed by
Kubernetes Publisher
parent
b7bf0a35f1
commit
94d52886d7
@@ -54,7 +54,7 @@ func (d *Decoder) Decode() (watch.EventType, runtime.Object, error) {
|
||||
return "", nil, fmt.Errorf("unable to decode to metav1.Event")
|
||||
}
|
||||
switch got.Type {
|
||||
case string(watch.Added), string(watch.Modified), string(watch.Deleted), string(watch.Error):
|
||||
case string(watch.Added), string(watch.Modified), string(watch.Deleted), string(watch.Error), string(watch.Bookmark):
|
||||
default:
|
||||
return "", nil, fmt.Errorf("got invalid watch event type: %v", got.Type)
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@ func getDecoder() runtime.Decoder {
|
||||
}
|
||||
|
||||
func TestDecoder(t *testing.T) {
|
||||
table := []watch.EventType{watch.Added, watch.Deleted, watch.Modified, watch.Error}
|
||||
table := []watch.EventType{watch.Added, watch.Deleted, watch.Modified, watch.Error, watch.Bookmark}
|
||||
|
||||
for _, eventType := range table {
|
||||
out, in := io.Pipe()
|
||||
|
@@ -56,6 +56,10 @@ func TestEncodeDecodeRoundTrip(t *testing.T) {
|
||||
watch.Deleted,
|
||||
&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}},
|
||||
},
|
||||
{
|
||||
watch.Bookmark,
|
||||
&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}},
|
||||
},
|
||||
}
|
||||
for i, testCase := range testCases {
|
||||
buf := &bytes.Buffer{}
|
||||
|
Reference in New Issue
Block a user