fix(tiller): ignore empty YAML documents during delete

Closes #2256
parent bc8b3bb1
...@@ -1058,7 +1058,10 @@ func (s *ReleaseServer) UninstallRelease(c ctx.Context, req *services.UninstallR ...@@ -1058,7 +1058,10 @@ func (s *ReleaseServer) UninstallRelease(c ctx.Context, req *services.UninstallR
// Collect the errors, and return them later. // Collect the errors, and return them later.
es := []string{} es := []string{}
for _, file := range filesToDelete { for _, file := range filesToDelete {
b := bytes.NewBufferString(file.content) b := bytes.NewBufferString(strings.TrimSpace(file.content))
if b.Len() == 0 {
continue
}
if err := s.env.KubeClient.Delete(rel.Namespace, b); err != nil { if err := s.env.KubeClient.Delete(rel.Namespace, b); err != nil {
log.Printf("uninstall: Failed deletion of %q: %s", req.Name, err) log.Printf("uninstall: Failed deletion of %q: %s", req.Name, err)
if err == kube.ErrNoObjectsVisited { if err == kube.ErrNoObjectsVisited {
......
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