Initialize API servers with negotiated serializers

Pass down into the server initialization the necessary interface for
handling client/server content type negotiation. Add integration tests
for the negotiation.
This commit is contained in:
Clayton Coleman
2015-12-21 00:27:49 -05:00
parent c49cd4edf9
commit 4d127dc969
11 changed files with 65 additions and 48 deletions

View File

@@ -83,6 +83,7 @@ func setUp(t *testing.T) (Master, *etcdtesting.EtcdTestServer, Config, *assert.A
func newMaster(t *testing.T) (*Master, *etcdtesting.EtcdTestServer, Config, *assert.Assertions) {
_, etcdserver, config, assert := setUp(t)
config.Serializer = api.Codecs
config.KubeletClient = client.FakeKubeletClient{}
config.ProxyDialer = func(network, addr string) (net.Conn, error) { return nil, nil }
@@ -496,7 +497,6 @@ func decodeResponse(resp *http.Response, obj interface{}) error {
if err != nil {
return err
}
if err := json.Unmarshal(data, obj); err != nil {
return err
}