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.
This commit is contained in:
Michelle Noorali 2016-08-25 12:30:02 -06:00
parent 926d7931d8
commit 50d8d36d8b

View file

@ -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
})
}