diff --git a/pkg/registry/controller_registry.go b/pkg/registry/controller_registry.go index 126b006d1a9..38abbb51b7b 100644 --- a/pkg/registry/controller_registry.go +++ b/pkg/registry/controller_registry.go @@ -59,6 +59,7 @@ func (storage *ControllerRegistryStorage) Delete(id string) error { func (storage *ControllerRegistryStorage) Extract(body string) (interface{}, error) { result := ReplicationController{} err := json.Unmarshal([]byte(body), &result) + result.Kind = "cluster#replicationController" return result, err } diff --git a/pkg/registry/controller_registry_test.go b/pkg/registry/controller_registry_test.go index 0f99b1117b9..9df4bc524e3 100644 --- a/pkg/registry/controller_registry_test.go +++ b/pkg/registry/controller_registry_test.go @@ -124,9 +124,9 @@ func TestExtractControllerJson(t *testing.T) { expectNoError(t, err) controllerOut, err := storage.Extract(string(body)) expectNoError(t, err) - jsonOut, err := json.Marshal(controllerOut) - expectNoError(t, err) - if string(body) != string(jsonOut) { + // Extract adds a Kind + controller.Kind = "cluster#replicationController" + if !reflect.DeepEqual(controller, controllerOut) { t.Errorf("Expected %#v, found %#v", controller, controllerOut) } } diff --git a/pkg/registry/service_registry.go b/pkg/registry/service_registry.go index 542219f001f..39c3c61be89 100644 --- a/pkg/registry/service_registry.go +++ b/pkg/registry/service_registry.go @@ -78,6 +78,7 @@ func (sr *ServiceRegistryStorage) Delete(id string) error { func (sr *ServiceRegistryStorage) Extract(body string) (interface{}, error) { var svc Service err := json.Unmarshal([]byte(body), &svc) + svc.Kind = "cluster#service" return svc, err }