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:
@@ -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 {
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user