update client.Config to use GroupVersion

This commit is contained in:
deads2k
2015-11-13 16:20:54 -05:00
committed by David Eads
parent 86ddc7592c
commit a87d927588
45 changed files with 314 additions and 224 deletions

View File

@@ -61,7 +61,6 @@ type testClient struct {
Response Response
Error bool
Created bool
Version string
server *httptest.Server
handler *util.FakeHandler
// For query args, an optional function to validate the contents
@@ -80,24 +79,16 @@ func (c *testClient) Setup(t *testing.T) *testClient {
}
c.server = httptest.NewServer(c.handler)
if c.Client == nil {
version := c.Version
if len(version) == 0 {
version = testapi.Default.Version()
}
c.Client = NewOrDie(&Config{
Host: c.server.URL,
Version: version,
Host: c.server.URL,
GroupVersion: testapi.Default.GroupVersion(),
})
// TODO: caesarxuchao: hacky way to specify version of Experimental client.
// We will fix this by supporting multiple group versions in Config
version = c.Version
if len(version) == 0 {
version = testapi.Extensions.Version()
}
c.ExtensionsClient = NewExtensionsOrDie(&Config{
Host: c.server.URL,
Version: version,
Host: c.server.URL,
GroupVersion: testapi.Extensions.GroupVersion(),
})
}
c.QueryValidator = map[string]func(string, string) bool{}