From af966391c76576f10cd898ae70f2fe1ee59d9cbd Mon Sep 17 00:00:00 2001 From: Maisem Ali Date: Sun, 16 Oct 2022 14:28:06 -0700 Subject: [PATCH] kube: handle 201 as a valid status code. Fixes tailscale/corp#7478 Signed-off-by: Maisem Ali --- kube/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kube/client.go b/kube/client.go index 82e4684ee..57832c0f0 100644 --- a/kube/client.go +++ b/kube/client.go @@ -100,7 +100,9 @@ func (c *Client) secretURL(name string) string { } func getError(resp *http.Response) error { - if resp.StatusCode == 200 { + if resp.StatusCode == 200 || resp.StatusCode == 201 { + // These are the only success codes returned by the Kubernetes API. + // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#http-status-codes return nil } st := &Status{}