mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-02 15:45:09 +00:00
client-go/rest/request: decodes initialEventsListBlueprint for watchlist requests
Kubernetes-commit: 7be192ae0bd5d9628c5ee37c2e8b843d602c0fa3
This commit is contained in:
committed by
Kubernetes Publisher
parent
9cff3e43bd
commit
d274c7ba36
@@ -19,6 +19,7 @@ package dynamic
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -183,7 +184,10 @@ func TestWatchList(t *testing.T) {
|
||||
{Type: watch.Bookmark, Object: func() runtime.Object {
|
||||
obj := getObject("gtest/vTest", "rTest", "item2")
|
||||
obj.SetResourceVersion("10")
|
||||
obj.SetAnnotations(map[string]string{metav1.InitialEventsAnnotationKey: "true"})
|
||||
obj.SetAnnotations(map[string]string{
|
||||
metav1.InitialEventsAnnotationKey: "true",
|
||||
metav1.InitialEventsListBlueprintAnnotationKey: base64.StdEncoding.EncodeToString(getJSON("vTest", "rTests", "")),
|
||||
})
|
||||
return obj
|
||||
}()},
|
||||
},
|
||||
@@ -195,9 +199,10 @@ func TestWatchList(t *testing.T) {
|
||||
},
|
||||
expectedList: &unstructured.UnstructuredList{
|
||||
Object: map[string]interface{}{
|
||||
"apiVersion": "",
|
||||
"kind": "UnstructuredList",
|
||||
"apiVersion": "vTest",
|
||||
"kind": "rTests",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "",
|
||||
"resourceVersion": "10",
|
||||
},
|
||||
},
|
||||
@@ -215,7 +220,10 @@ func TestWatchList(t *testing.T) {
|
||||
{Type: watch.Bookmark, Object: func() runtime.Object {
|
||||
obj := getObject("gtest/vTest", "rTest", "item2")
|
||||
obj.SetResourceVersion("39")
|
||||
obj.SetAnnotations(map[string]string{metav1.InitialEventsAnnotationKey: "true"})
|
||||
obj.SetAnnotations(map[string]string{
|
||||
metav1.InitialEventsAnnotationKey: "true",
|
||||
metav1.InitialEventsListBlueprintAnnotationKey: base64.StdEncoding.EncodeToString(getJSON("vTest", "rTests", "")),
|
||||
})
|
||||
return obj
|
||||
}()},
|
||||
},
|
||||
@@ -227,9 +235,10 @@ func TestWatchList(t *testing.T) {
|
||||
},
|
||||
expectedList: &unstructured.UnstructuredList{
|
||||
Object: map[string]interface{}{
|
||||
"apiVersion": "",
|
||||
"kind": "UnstructuredList",
|
||||
"apiVersion": "vTest",
|
||||
"kind": "rTests",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "",
|
||||
"resourceVersion": "39",
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user