Move namespace from query param to path part

This commit is contained in:
derekwaynecarr
2014-12-09 14:23:21 -05:00
parent 58ba3c7faa
commit 7cf664439f
16 changed files with 388 additions and 156 deletions

View File

@@ -192,7 +192,7 @@ func TestDefaultErrorFunc(t *testing.T) {
}
mux := http.NewServeMux()
// FakeHandler musn't be sent requests other than the one you want to test.
mux.Handle("/api/"+testapi.Version()+"/pods/foo", &handler)
mux.Handle("/api/"+testapi.Version()+"/ns/bar/pods/foo", &handler)
server := httptest.NewServer(mux)
defer server.Close()
factory := NewConfigFactory(client.NewOrDie(&client.Config{Host: server.URL, Version: testapi.Version()}))
@@ -213,7 +213,7 @@ func TestDefaultErrorFunc(t *testing.T) {
if !exists {
continue
}
handler.ValidateRequest(t, "/api/"+testapi.Version()+"/pods/foo?namespace=bar", "GET", nil)
handler.ValidateRequest(t, "/api/"+testapi.Version()+"/ns/bar/pods/foo", "GET", nil)
if e, a := testPod, got; !reflect.DeepEqual(e, a) {
t.Errorf("Expected %v, got %v", e, a)
}