pulumi/pkg
Michael Bridgen 171f41f028 Fix AssertHTTPResultWithRetry
`err` is declared outside the retry loop, and tested after all the
retries to see if it is non-nil; however, err is shadowed inside the
loop so will never be non-nil outside. If all the attempts are failures,
it'll time out then try to read the body of the response and probably
panic.

This commit fixes that problem by only assigning to err inside the loop.
A related problem is that failing all the attempts doesn't result in an
error, it just breaks the loop. Again it's possible to get a panic. So:
assign an error value when abandoning the retries.

Also: make sure response bodies are read and closed, to co-operate with
connection pooling.

Lastly, a tweak that helps fail faster: rather than sleeping then seeing
if the deadline has passed, check whether sleeping will break the
deadline. It will always try once, in any case.

Signed-off-by: Michael Bridgen <mbridgen@pulumi.com>
2022-11-15 10:41:54 +00:00
..
authhelpers Add support for authentication via GOOGLE_CREDENTIALS (#6379) 2022-06-07 16:02:08 +01:00
backend [color] Use graphemes to measure strings. 2022-11-09 08:23:00 -08:00
cmd/pulumi Support PCL as a convert input (and output) 2022-11-11 10:45:40 +00:00
codegen Regen code with consistent spacing in tsconfig 2022-11-10 22:44:11 -05:00
engine Merge #11272 2022-11-08 22:49:57 +00:00
graph Update error handling (#8406) 2021-11-12 18:37:17 -08:00
operations ci: gofmt 1.18+ clean 2022-09-21 09:48:39 -07:00
resource Merge #11274 2022-11-09 18:13:42 +00:00
secrets Merge #11094 2022-10-24 11:33:21 +00:00
testing/integration Fix AssertHTTPResultWithRetry 2022-11-15 10:41:54 +00:00
util Introduce PULUMI_DEBUG_GRPC support 2022-11-08 14:01:15 -05:00
version duplicate version to ensure linking is properly handled 2020-03-19 12:49:34 -07:00
README.md export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
go.mod chore: post-release go.mod updates 2022-11-09 02:46:00 +00:00
go.sum Update YAML to 1.0.2 2022-11-08 15:05:56 -08:00

README.md

pulumi/pkg

While pulumi/sdk maintains strict backwards compatibility guarantees, code under pkg/ is handled more informally: while breaking changes are still discouraged they may happen when they make sense.