From 92357a54ec8fd8e39a71281d0c882ee11750feeb Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Fri, 22 Jul 2022 13:53:42 -0400 Subject: [PATCH] cmd/gitops-pusher: fix minor bug with ACL tests (#5123) Signed-off-by: Xe --- cmd/gitops-pusher/gitops-pusher.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/gitops-pusher/gitops-pusher.go b/cmd/gitops-pusher/gitops-pusher.go index 96e7d8d2d..5cc53f7c3 100644 --- a/cmd/gitops-pusher/gitops-pusher.go +++ b/cmd/gitops-pusher/gitops-pusher.go @@ -237,12 +237,6 @@ func testNewACLs(ctx context.Context, tailnet, apiKey, policyFname string) error } defer resp.Body.Close() - got := resp.StatusCode - want := http.StatusOK - if got != want { - return fmt.Errorf("wanted HTTP status code %d but got %d", want, got) - } - var ate ACLTestError err = json.NewDecoder(resp.Body).Decode(&ate) if err != nil { @@ -253,6 +247,12 @@ func testNewACLs(ctx context.Context, tailnet, apiKey, policyFname string) error return ate } + got := resp.StatusCode + want := http.StatusOK + if got != want { + return fmt.Errorf("wanted HTTP status code %d but got %d", want, got) + } + return nil }