mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Merge pull request #839 from yugui/fix/api-status
Make storage.Delete return *api.Status instead of api.Status
This commit is contained in:
commit
c6dcfd544f
@ -69,7 +69,7 @@ func (storage *ControllerRegistryStorage) Get(id string) (interface{}, error) {
|
|||||||
// Delete asynchronously deletes the ReplicationController specified by its id.
|
// Delete asynchronously deletes the ReplicationController specified by its id.
|
||||||
func (storage *ControllerRegistryStorage) Delete(id string) (<-chan interface{}, error) {
|
func (storage *ControllerRegistryStorage) Delete(id string) (<-chan interface{}, error) {
|
||||||
return apiserver.MakeAsync(func() (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
|
}), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,6 +100,6 @@ func (storage *MinionRegistryStorage) Delete(id string) (<-chan interface{}, err
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return apiserver.MakeAsync(func() (interface{}, error) {
|
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
|
}), nil
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ func TestMinionRegistryStorage(t *testing.T) {
|
|||||||
t.Errorf("delete failed")
|
t.Errorf("delete failed")
|
||||||
}
|
}
|
||||||
obj = <-c
|
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)
|
t.Errorf("delete return value was weird: %#v", obj)
|
||||||
}
|
}
|
||||||
if _, err := ms.Get("bar"); err != ErrDoesNotExist {
|
if _, err := ms.Get("bar"); err != ErrDoesNotExist {
|
||||||
|
@ -185,7 +185,7 @@ func (storage *PodRegistryStorage) Get(id string) (interface{}, error) {
|
|||||||
|
|
||||||
func (storage *PodRegistryStorage) Delete(id string) (<-chan interface{}, error) {
|
func (storage *PodRegistryStorage) Delete(id string) (<-chan interface{}, error) {
|
||||||
return apiserver.MakeAsync(func() (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
|
}), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ func (sr *ServiceRegistryStorage) Delete(id string) (<-chan interface{}, error)
|
|||||||
}
|
}
|
||||||
return apiserver.MakeAsync(func() (interface{}, error) {
|
return apiserver.MakeAsync(func() (interface{}, error) {
|
||||||
sr.deleteExternalLoadBalancer(service)
|
sr.deleteExternalLoadBalancer(service)
|
||||||
return api.Status{Status: api.StatusSuccess}, sr.registry.DeleteService(id)
|
return &api.Status{Status: api.StatusSuccess}, sr.registry.DeleteService(id)
|
||||||
}), nil
|
}), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user