Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Commit

Permalink
[HOTFIX] Fix bug with error transport (#1785)
Browse files Browse the repository at this point in the history
* Fix bug with error transport.

* Fix values.yaml
  • Loading branch information
krasish authored Mar 23, 2021
1 parent f251517 commit fad86b9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion chart/compass/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ global:
version: "PR-1750"
operations_controller:
dir:
version: "PR-1781"
version: "PR-1785"
tenant_fetcher:
dir:
version: "PR-1750"
Expand Down
8 changes: 4 additions & 4 deletions components/operations-controller/internal/webhook/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,17 @@ func (c *client) Do(ctx context.Context, request *Request) (*web_hook.Response,
return nil, recerr.NewFatalReconcileErrorFromExisting(errors.Wrap(err, "unable to parse response into webhook output template"))
}

if err = checkForGoneStatus(resp, response.GoneStatusCode); err != nil {
return response, err
}

isLocationEmpty := response.Location != nil && *response.Location == ""
isAsyncWebhook := webhook.Mode != nil && *webhook.Mode == graphql.WebhookModeAsync

if isLocationEmpty && isAsyncWebhook {
return nil, errors.New("missing location url after executing async webhook")
}

if err = checkForGoneStatus(resp, response.GoneStatusCode); err != nil {
return response, err
}

return response, checkForErr(resp, response.SuccessStatusCode, response.Error)
}

Expand Down
2 changes: 1 addition & 1 deletion components/operations-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func fatalOnError(err error) {
}

func prepareHttpClient(cfg *httputil.Config) (*http.Client, error) {
httpTransport := httputil.NewCorrelationIDTransport(httputil.NewErrorHandlerTransport(httputil.NewHTTPTransport(cfg)))
httpTransport := httputil.NewCorrelationIDTransport(httputil.NewHTTPTransport(cfg))

unsecuredClient := &http.Client{
Transport: httpTransport,
Expand Down

0 comments on commit fad86b9

Please sign in to comment.