Skip to content

Commit

Permalink
fix: omit response body from config push error (#284)
Browse files Browse the repository at this point in the history
Omit the response body from config push error strings.
ReloadDeclarativeRawConfig already returns the body separately, so
formatting it into the error is unnecessary.
  • Loading branch information
rainest authored Feb 22, 2023
1 parent d255ca5 commit c71247b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Table of Contents

- [v0.38.1](#v0381)
- [v0.38.0](#v0380)
- [v0.37.0](#v0370)
- [v0.36.0](#v0360)
Expand Down Expand Up @@ -49,6 +50,15 @@

## [v0.38.0]

> Release date: 2023/02/22
- Omit response body from error when config push fails. The body can be quite
large and will result in massive logs downstream if included in the error.
The body is returned along with the error and downstream clients and log it
separately if they so desire.

## [v0.38.0]

> Release date: 2023/02/13
- Added `instance_name` to Plugin schema.
Expand Down Expand Up @@ -692,6 +702,7 @@ authentication credentials in Kong.
releases of Kong since every release of Kong is introducing breaking changes
to the Admin API.

[v0.38.1]: https://github.com/Kong/go-kong/compare/v0.38.0...v0.38.1
[v0.38.0]: https://github.com/Kong/go-kong/compare/v0.37.0...v0.38.0
[v0.37.0]: https://github.com/Kong/go-kong/compare/v0.36.0...v0.37.0
[v0.36.0]: https://github.com/Kong/go-kong/compare/v0.35.0...v0.36.0
Expand Down
2 changes: 1 addition & 1 deletion kong/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ func (c *Client) ReloadDeclarativeRawConfig(
return nil, fmt.Errorf("could not read /config %d status response body: %w", resp.StatusCode, err)
}
if resp.StatusCode < 200 || resp.StatusCode >= 400 {
return b, fmt.Errorf("failed posting new config to /config: got status code %d and body %s", resp.StatusCode, b)
return b, fmt.Errorf("failed posting new config to /config: got status code %d", resp.StatusCode)
}

return b, nil
Expand Down

0 comments on commit c71247b

Please sign in to comment.