Refactor Get and Describe to allow extension of types

Get should use ResourceMapper, allow Printer to be abstracted,
and extract Describe as *Describer types.
This commit is contained in:
Clayton Coleman
2014-10-27 15:56:34 -04:00
parent 39882a3555
commit 09cfa364c5
18 changed files with 753 additions and 339 deletions

View File

@@ -35,7 +35,7 @@ func (c *FakePods) List(selector labels.Selector) (*api.PodList, error) {
func (c *FakePods) Get(name string) (*api.Pod, error) {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "get-pod", Value: name})
return &api.Pod{}, nil
return &api.Pod{ObjectMeta: api.ObjectMeta{Name: name, Namespace: c.Namespace}}, nil
}
func (c *FakePods) Delete(name string) error {

View File

@@ -36,7 +36,7 @@ func (c *FakeServices) List(selector labels.Selector) (*api.ServiceList, error)
func (c *FakeServices) Get(name string) (*api.Service, error) {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "get-service", Value: name})
return &api.Service{}, nil
return &api.Service{ObjectMeta: api.ObjectMeta{Name: name, Namespace: c.Namespace}}, nil
}
func (c *FakeServices) Create(service *api.Service) (*api.Service, error) {