From 41e60dae802515b440b68ac8052b90cb9bc93457 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Thu, 21 Jul 2022 13:02:14 -0400 Subject: [PATCH] cmd/gitops-pusher: use fmt.Println for errors (#5112) Signed-off-by: Xe --- cmd/gitops-pusher/gitops-pusher.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/gitops-pusher/gitops-pusher.go b/cmd/gitops-pusher/gitops-pusher.go index 007954ad4..54e62818d 100644 --- a/cmd/gitops-pusher/gitops-pusher.go +++ b/cmd/gitops-pusher/gitops-pusher.go @@ -64,7 +64,8 @@ func main() { } if err := applyNewACL(ctx, tailnet, apiKey, *policyFname, controlEtag); err != nil { - log.Fatal(err) + fmt.Println(err) + os.Exit(1) } case "test": @@ -87,7 +88,8 @@ func main() { } if err := testNewACLs(ctx, tailnet, apiKey, *policyFname); err != nil { - log.Fatal(err) + fmt.Println(err) + os.Exit(1) } default: log.Fatalf("usage: %s [options] ", os.Args[0]) @@ -191,7 +193,7 @@ func testNewACLs(ctx context.Context, tailnet, apiKey, policyFname string) error return nil } -var lineColMessageSplit = regexp.MustCompile(`^line ([0-9]+), column ([0-9]+): (.*)$`) +var lineColMessageSplit = regexp.MustCompile(`line ([0-9]+), column ([0-9]+): (.*)$`) type ACLTestError struct { Message string `json:"message"`