about summary refs log tree commit diff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go18
1 files changed, 14 insertions, 4 deletions
diff --git a/main.go b/main.go
index 00d06e7dc0a2..f5af42015057 100644
--- a/main.go
+++ b/main.go
@@ -75,8 +75,11 @@ func applyCommand() cli.Command {
 			include := c.StringSlice("include")
 			exclude := c.StringSlice("exclude")
 			ctx, err := loadContext(c)
-			resources, err := templater.LoadAndPrepareTemplates(&include, &exclude, ctx)
+			if err != nil {
+				return err
+			}
 
+			resources, err := templater.LoadAndPrepareTemplates(&include, &exclude, ctx)
 			if err != nil {
 				return err
 			}
@@ -102,8 +105,11 @@ func replaceCommand() cli.Command {
 			include := c.StringSlice("include")
 			exclude := c.StringSlice("exclude")
 			ctx, err := loadContext(c)
-			resources, err := templater.LoadAndPrepareTemplates(&include, &exclude, ctx)
+			if err != nil {
+				return err
+			}
 
+			resources, err := templater.LoadAndPrepareTemplates(&include, &exclude, ctx)
 			if err != nil {
 				return err
 			}
@@ -122,9 +128,13 @@ func deleteCommand() cli.Command {
 		Action: func(c *cli.Context) error {
 			include := c.StringSlice("include")
 			exclude := c.StringSlice("exclude")
+
 			ctx, err := loadContext(c)
-			resources, err := templater.LoadAndPrepareTemplates(&include, &exclude, ctx)
+			if err != nil {
+				return err
+			}
 
+			resources, err := templater.LoadAndPrepareTemplates(&include, &exclude, ctx)
 			if err != nil {
 				return err
 			}
@@ -186,7 +196,7 @@ func loadContext(c *cli.Context) (*context.Context, error) {
 		return nil, meep.New(
 			&meep.ErrInvalidParam{
 				Param:  "file",
-				Reason: "Cluster config file must be specified",
+				Reason: "Cluster config file must be specified (-f)",
 			},
 		)
 	}