Преглед изворни кода

kube: handle 201 as a valid status code.

Fixes tailscale/corp#7478

Signed-off-by: Maisem Ali <[email protected]>
Maisem Ali пре 3 година
родитељ
комит
af966391c7
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      kube/client.go

+ 3 - 1
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{}