Prepare for content-type negotiation
Combine the fields that will be used for content transformation (content-type, codec, and group version) into a single struct in client, and then pass that struct into the rest client and request. Set the content-type when sending requests to the server, and accept the content type as primary. Will form the foundation for content-negotiation via the client.
This commit is contained in:
@@ -43,7 +43,7 @@ func TestClient(t *testing.T) {
|
||||
|
||||
ns := api.NamespaceDefault
|
||||
framework.DeleteAllEtcdKeys()
|
||||
client := client.NewOrDie(&client.Config{Host: s.URL, GroupVersion: testapi.Default.GroupVersion()})
|
||||
client := client.NewOrDie(&client.Config{Host: s.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
|
||||
|
||||
info, err := client.Discovery().ServerVersion()
|
||||
if err != nil {
|
||||
@@ -113,7 +113,7 @@ func TestSingleWatch(t *testing.T) {
|
||||
|
||||
ns := "blargh"
|
||||
deleteAllEtcdKeys()
|
||||
client := client.NewOrDie(&client.Config{Host: s.URL, GroupVersion: testapi.Default.GroupVersion()})
|
||||
client := client.NewOrDie(&client.Config{Host: s.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
|
||||
|
||||
mkEvent := func(i int) *api.Event {
|
||||
name := fmt.Sprintf("event-%v", i)
|
||||
@@ -197,7 +197,7 @@ func TestMultiWatch(t *testing.T) {
|
||||
defer s.Close()
|
||||
|
||||
ns := api.NamespaceDefault
|
||||
client := client.NewOrDie(&client.Config{Host: s.URL, GroupVersion: testapi.Default.GroupVersion()})
|
||||
client := client.NewOrDie(&client.Config{Host: s.URL, ContentConfig: client.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
|
||||
|
||||
dummyEvent := func(i int) *api.Event {
|
||||
name := fmt.Sprintf("unrelated-%v", i)
|
||||
|
Reference in New Issue
Block a user