v1.7.1
This commit is contained in:
@@ -78,7 +78,7 @@ func (ldc *LegacyDecortClient) DecortApiCall(ctx context.Context, method, url st
|
||||
|
||||
k8sCaCreateReq, okCa := params.(k8s_ca.CreateRequest)
|
||||
k8sCbCreateReq, okCb := params.(k8s_cb.CreateRequest)
|
||||
|
||||
|
||||
var body *bytes.Buffer
|
||||
var ctype string
|
||||
|
||||
@@ -93,7 +93,7 @@ func (ldc *LegacyDecortClient) DecortApiCall(ctx context.Context, method, url st
|
||||
}
|
||||
body = bytes.NewBufferString(values.Encode() + fmt.Sprintf("&authkey=%s", ldc.cfg.Token))
|
||||
}
|
||||
|
||||
|
||||
req, err := http.NewRequestWithContext(ctx, method, ldc.decortURL+restmachine+url, body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -159,22 +159,20 @@ func (ldc *LegacyDecortClient) do(req *http.Request, ctype string) (*http.Respon
|
||||
// var resp *http.Response
|
||||
// var err error
|
||||
buf, _ := io.ReadAll(req.Body)
|
||||
// req = req.Clone(req.Context())
|
||||
|
||||
// for i := uint64(0); i < ldc.cfg.Retries; i++ {
|
||||
|
||||
// req = req.Clone(req.Context())
|
||||
req.Body = io.NopCloser(bytes.NewBuffer(buf))
|
||||
resp, err := ldc.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)
|
||||
}
|
||||
@@ -402,7 +400,7 @@ func createK8sCloudBrokerLegacy(req k8s_cb.CreateRequest, token string) (*bytes.
|
||||
}
|
||||
|
||||
_ = writer.WriteField("extnetOnly", strconv.FormatBool(req.ExtNetOnly))
|
||||
|
||||
|
||||
_ = writer.WriteField("authkey", token)
|
||||
|
||||
ct := writer.FormDataContentType()
|
||||
|
||||
Reference in New Issue
Block a user