make delete waits match on UID

This commit is contained in:
David Eads
2018-07-12 14:35:59 -04:00
parent d2696d5612
commit 9fe20cfd46
6 changed files with 112 additions and 11 deletions

View File

@@ -94,18 +94,18 @@ func (m *Helper) WatchSingle(namespace, name, resourceVersion string) (watch.Int
Watch()
}
func (m *Helper) Delete(namespace, name string) error {
func (m *Helper) Delete(namespace, name string) (runtime.Object, error) {
return m.DeleteWithOptions(namespace, name, nil)
}
func (m *Helper) DeleteWithOptions(namespace, name string, options *metav1.DeleteOptions) error {
func (m *Helper) DeleteWithOptions(namespace, name string, options *metav1.DeleteOptions) (runtime.Object, error) {
return m.RESTClient.Delete().
NamespaceIfScoped(namespace, m.NamespaceScoped).
Resource(m.Resource).
Name(name).
Body(options).
Do().
Error()
Get()
}
func (m *Helper) Create(namespace string, modify bool, obj runtime.Object) (runtime.Object, error) {

View File

@@ -129,7 +129,7 @@ func TestHelperDelete(t *testing.T) {
RESTClient: client,
NamespaceScoped: true,
}
err := modifier.Delete("bar", "foo")
_, err := modifier.Delete("bar", "foo")
if (err != nil) != tt.Err {
t.Errorf("unexpected error: %t %v", tt.Err, err)
}