Skip to content

Commit

Permalink
fix(sgcloudrun): handle response status errors from reading secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
alethenorio committed Jan 17, 2025
1 parent 56e49b4 commit e564f4a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/sgcloudrun/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ func accessSecretVersion(ctx context.Context, accessToken, project, secret, vers
if err != nil {
return "", err
}
if response.StatusCode < 200 || response.StatusCode > 299 {
return "", fmt.Errorf("expected 200 response status, received %d", response.StatusCode)
}
defer func() {
_ = response.Body.Close()
}()
Expand Down

0 comments on commit e564f4a

Please sign in to comment.