dynamic: The dynamic client no longer needs a special cased watch

By correctly handling content type negotiation, we can avoid the
need for a special version of watch and use the same code path as
typed clients.

Kubernetes-commit: 3f94f80b0a79293e54d7080aaf7a64d7df8b1d4a
This commit is contained in:
Clayton Coleman
2019-11-03 15:10:12 -05:00
committed by Kubernetes Publisher
parent 4b146a95cd
commit 881cd219a8
3 changed files with 45 additions and 60 deletions

View File

@@ -537,6 +537,8 @@ func TestWatch(t *testing.T) {
t.Errorf("Watch(%q) got query %s. wanted %s", tc.name, r.URL.RawQuery, tc.query)
}
w.Header().Set("Content-Type", "application/json")
enc := restclientwatch.NewEncoder(streaming.NewEncoder(w, unstructured.UnstructuredJSONScheme), unstructured.UnstructuredJSONScheme)
for _, e := range tc.events {
enc.Encode(&e)