@@ -103,22 +103,30 @@ func (c Client) DoDelete(ctx context.Context, objs ...runtime.Object) error {
103
103
}
104
104
kind := obj .GetObjectKind ().GroupVersionKind ().Kind
105
105
log .Infof (" Deleting %s %q" , kind , getName (a .GetNamespace (), a .GetName ()))
106
- err = c .KubeClient .Delete (ctx , obj , client .PropagationPolicy (metav1 .DeletePropagationForeground ))
106
+ err = c .KubeClient .Delete (ctx , obj , client .PropagationPolicy (metav1 .DeletePropagationBackground ))
107
107
if err != nil {
108
108
if ! apierrors .IsNotFound (err ) {
109
109
return err
110
110
}
111
111
log .Infof (" %s %q does not exist" , kind , getName (a .GetNamespace (), a .GetName ()))
112
112
}
113
+ key , err := client .ObjectKeyFromObject (obj )
114
+ if err != nil {
115
+ return err
116
+ }
117
+ if err := wait .PollImmediateUntil (time .Millisecond * 100 , func () (bool , error ) {
118
+ err := c .KubeClient .Get (ctx , key , obj )
119
+ if apierrors .IsNotFound (err ) {
120
+ return true , nil
121
+ } else if err != nil {
122
+ return false , err
123
+ }
124
+ return false , nil
125
+ }, ctx .Done ()); err != nil {
126
+ return err
127
+ }
113
128
}
114
-
115
- log .Infof (" Waiting for deleted resources to disappear" )
116
-
117
- return wait .PollImmediateUntil (time .Second , func () (bool , error ) {
118
- s := c .GetObjectsStatus (ctx , objs ... )
119
- installed , err := s .HasInstalledResources ()
120
- return ! installed , err
121
- }, ctx .Done ())
129
+ return nil
122
130
}
123
131
124
132
func getName (namespace , name string ) string {
0 commit comments