INNER CODE UNIT · Go

putSoakArchiveObject

redpanda-data/connect · benchmarking/aws/runner/main.go:829

func putSoakArchiveObject(ctx context.Context, client *s3.Client, bucket, key string, body []byte) error {
	if _, err := client.PutObject(ctx, &s3.PutObjectInput{
		Bucket: &bucket, Key: &key, Body: bytes.NewReader(body),
	}); err != nil {
		return wrapSoakArchiveUploadErr(key, bucket, err)
	}
	return nil
}

// wrapSoakArchiveUploadErr adds an actionable hint to a soak-archive upload
// error when it's specifically a missing bucket: that bucket is created by
// the persistent terraform stack, not by any bench session's own apply, so
// a fresh account (or one where the persistent stack hasn't been applied
// yet) hits this on its very first soak run, and "NoSuchBucket" alone gives
// no clue what to do about it. Split out from putSoakArchiveObject so the
// message can be pinned in a test without a real S3 client (see
// TestWrapSoakArchiveUploadErr_NoSuchBucket).
func wrapSoakArchiveUploadErr(key, bucket string, err error) error {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…