Skip to content

Commit

Permalink
Make storage.Delete return *api.Status instead of api.Status
Browse files Browse the repository at this point in the history
as apiserver.APIServer.finishReq expects.

This solves the warning in finishReq:
"programmer error: use *api.Status as a result, not api.Status."
  • Loading branch information
yugui committed Aug 9, 2014
1 parent c718661 commit d359f3c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/registry/controllerstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (storage *ControllerRegistryStorage) Get(id string) (interface{}, error) {
// Delete asynchronously deletes the ReplicationController specified by its id.
func (storage *ControllerRegistryStorage) Delete(id string) (<-chan interface{}, error) {
return apiserver.MakeAsync(func() (interface{}, error) {
return api.Status{Status: api.StatusSuccess}, storage.registry.DeleteController(id)
return &api.Status{Status: api.StatusSuccess}, storage.registry.DeleteController(id)
}), nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/registry/minionstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ func (storage *MinionRegistryStorage) Delete(id string) (<-chan interface{}, err
return nil, err
}
return apiserver.MakeAsync(func() (interface{}, error) {
return api.Status{Status: api.StatusSuccess}, storage.registry.Delete(id)
return &api.Status{Status: api.StatusSuccess}, storage.registry.Delete(id)
}), nil
}
2 changes: 1 addition & 1 deletion pkg/registry/minionstorage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestMinionRegistryStorage(t *testing.T) {
t.Errorf("delete failed")
}
obj = <-c
if s, ok := obj.(api.Status); !ok || s.Status != api.StatusSuccess {
if s, ok := obj.(*api.Status); !ok || s.Status != api.StatusSuccess {
t.Errorf("delete return value was weird: %#v", obj)
}
if _, err := ms.Get("bar"); err != ErrDoesNotExist {
Expand Down
2 changes: 1 addition & 1 deletion pkg/registry/podstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (storage *PodRegistryStorage) Get(id string) (interface{}, error) {

func (storage *PodRegistryStorage) Delete(id string) (<-chan interface{}, error) {
return apiserver.MakeAsync(func() (interface{}, error) {
return api.Status{Status: api.StatusSuccess}, storage.registry.DeletePod(id)
return &api.Status{Status: api.StatusSuccess}, storage.registry.DeletePod(id)
}), nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/registry/servicestorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (sr *ServiceRegistryStorage) Delete(id string) (<-chan interface{}, error)
}
return apiserver.MakeAsync(func() (interface{}, error) {
sr.deleteExternalLoadBalancer(service)
return api.Status{Status: api.StatusSuccess}, sr.registry.DeleteService(id)
return &api.Status{Status: api.StatusSuccess}, sr.registry.DeleteService(id)
}), nil
}

Expand Down

0 comments on commit d359f3c

Please sign in to comment.