diff --git a/cli/app/app.go b/cli/app/app.go index 75668b5e..d57f2afd 100644 --- a/cli/app/app.go +++ b/cli/app/app.go @@ -254,7 +254,6 @@ func createOutFile(out string) *os.File { if err != nil { logrus.Fatalf("error opening file: %v", err) } - defer f.Close() } return f } @@ -595,6 +594,7 @@ func ProjectKuberConvert(p *project.Project, c *cli.Context) { } f := createOutFile(outFile) + defer f.Close() var mServices map[string]api.Service = make(map[string]api.Service) var serviceLinks []string