v1.7.1
This commit is contained in:
15
client.go
15
client.go
@@ -164,21 +164,20 @@ func (dc *DecortClient) do(req *http.Request, ctype string) (*http.Response, err
|
||||
// var resp *http.Response
|
||||
// var err error
|
||||
buf, _ := io.ReadAll(req.Body)
|
||||
// req = req.Clone(req.Context())
|
||||
|
||||
// for i := uint64(0); i < dc.cfg.Retries; i++ {
|
||||
// req = req.Clone(req.Context())
|
||||
req.Body = io.NopCloser(bytes.NewBuffer(buf))
|
||||
resp, err := dc.client.Do(req)
|
||||
|
||||
// if err == nil {
|
||||
if resp.StatusCode == 200 {
|
||||
return resp, err
|
||||
if err == nil {
|
||||
if resp.StatusCode == 200 {
|
||||
return resp, err
|
||||
}
|
||||
}
|
||||
// }
|
||||
respBytes, _ := io.ReadAll(resp.Body)
|
||||
err = fmt.Errorf("%s", respBytes)
|
||||
resp.Body.Close()
|
||||
// }
|
||||
// }
|
||||
|
||||
return nil, fmt.Errorf("could not execute request: %w", err)
|
||||
}
|
||||
@@ -404,7 +403,7 @@ func createK8sCloudBroker(req k8s_cb.CreateRequest) (*bytes.Buffer, string) {
|
||||
}
|
||||
|
||||
_ = writer.WriteField("extnetOnly", strconv.FormatBool(req.ExtNetOnly))
|
||||
|
||||
|
||||
ct := writer.FormDataContentType()
|
||||
|
||||
writer.Close()
|
||||
|
||||
Reference in New Issue
Block a user