Skip to content

Commit

Permalink
fix: AWS status check within KES
Browse files Browse the repository at this point in the history
the returned response body is not closed casued the file descriptor exceed the system limit
  • Loading branch information
Einsteinder authored and aead committed Feb 10, 2024
1 parent 16a6929 commit 0ed2a14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/keystore/aws/secrets-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,12 @@ func (s *Store) Status(ctx context.Context) (kes.KeyStoreState, error) {
}

start := time.Now()
if _, err = http.DefaultClient.Do(req); err != nil {
res, err := http.DefaultClient.Do(req)
if err != nil {
return kes.KeyStoreState{}, &keystore.ErrUnreachable{Err: err}
}
defer res.Body.Close()

Check failure on line 120 in internal/keystore/aws/secrets-manager.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `gofumpt`-ed (gofumpt)
return kes.KeyStoreState{
Latency: time.Since(start),
}, nil
Expand Down

0 comments on commit 0ed2a14

Please sign in to comment.