Commit 50d8d36d authored by Michelle Noorali's avatar Michelle Noorali

ref(kube): delete skips IsNotFound errs

Currently, delete returns an error if a resource is not found.
That is a bit confusing because if you delete something that
is not found, the end state is not really an error. The end
state is what you wanted to do in the first place. This type
of error is not propogated from the kube client but it is logged
in tiller.  We could also change this to keep returning errors
(even the not found) and filter it out in the release server.
parent 926d7931
......@@ -221,10 +221,16 @@ func (c *Client) Delete(namespace string, reader io.Reader) error {
if kubectl.IsNoSuchReaperError(err) {
return resource.NewHelper(info.Client, info.Mapping).Delete(info.Namespace, info.Name)
}
return err
}
log.Printf("Using reaper for deleting %s", info.Name)
return reaper.Stop(info.Namespace, info.Name, 0, nil)
err = reaper.Stop(info.Namespace, info.Name, 0, nil)
if err != nil && errors.IsNotFound(err) {
log.Printf("%v", err)
return nil
}
return err
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment