mirror of
https://github.com/tailscale/tailscale.git
synced 2024-12-04 15:35:38 +00:00
cmd/gitops-pusher: fix minor bug with ACL tests
Signed-off-by: Xe <xe@tailscale.com>
This commit is contained in:
parent
707df2efb2
commit
1444e34521
@ -15,6 +15,7 @@
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/http/httputil"
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
@ -237,12 +238,6 @@ func testNewACLs(ctx context.Context, tailnet, apiKey, policyFname string) error
|
|||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
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
|
var ate ACLTestError
|
||||||
err = json.NewDecoder(resp.Body).Decode(&ate)
|
err = json.NewDecoder(resp.Body).Decode(&ate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -253,6 +248,14 @@ func testNewACLs(ctx context.Context, tailnet, apiKey, policyFname string) error
|
|||||||
return ate
|
return ate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
got := resp.StatusCode
|
||||||
|
want := http.StatusOK
|
||||||
|
if got != want {
|
||||||
|
data, _ := httputil.DumpResponse(resp, true)
|
||||||
|
os.Stderr.Write(data)
|
||||||
|
return fmt.Errorf("wanted HTTP status code %d but got %d", want, got)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user