Propagate rename; tests pass again.

This commit is contained in:
Daniel Smith
2014-08-31 22:10:49 -07:00
parent 7615c00a9a
commit 099c8fd36f
35 changed files with 183 additions and 151 deletions

View File

@@ -31,6 +31,7 @@ import (
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/apitools"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/version"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
@@ -40,11 +41,11 @@ func convert(obj interface{}) (interface{}, error) {
return obj, nil
}
var codec = api.Codec
var codec = apitools.Codec
func init() {
api.AddKnownTypes("", Simple{}, SimpleList{})
api.AddKnownTypes("v1beta1", Simple{}, SimpleList{})
apitools.AddKnownTypes("", Simple{}, SimpleList{})
apitools.AddKnownTypes("v1beta1", Simple{}, SimpleList{})
}
type Simple struct {
@@ -696,7 +697,7 @@ func TestWriteJSONDecodeError(t *testing.T) {
type T struct {
Value string
}
writeJSON(http.StatusOK, api.Codec, &T{"Undecodable"}, w)
writeJSON(http.StatusOK, apitools.Codec, &T{"Undecodable"}, w)
}))
status := expectApiStatus(t, "GET", server.URL, nil, http.StatusInternalServerError)
if status.Reason != api.StatusReasonUnknown {

View File

@@ -24,6 +24,7 @@ import (
"code.google.com/p/go.net/websocket"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/common"
"github.com/GoogleCloudPlatform/kubernetes/pkg/httplog"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
@@ -112,7 +113,7 @@ func (w *WatchServer) HandleWS(ws *websocket.Conn) {
}
err := websocket.JSON.Send(ws, &api.WatchEvent{
Type: event.Type,
Object: api.APIObject{event.Object},
Object: common.Object{event.Object},
})
if err != nil {
// Client disconnect.
@@ -159,7 +160,7 @@ func (self *WatchServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
}
err := encoder.Encode(&api.WatchEvent{
Type: event.Type,
Object: api.APIObject{event.Object},
Object: common.Object{event.Object},
})
if err != nil {
// Client disconnect.