Skip to content

Commit

Permalink
fix s3 location when using custom endpoint (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 authored Apr 17, 2024
1 parent b9cecd7 commit ea24d03
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/pipeline/sink/uploader/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,10 @@ func (u *S3Uploader) upload(localFilepath, storageFilepath string, outputType ty
return "", 0, wrap("S3", err)
}

return fmt.Sprintf("https://%s.s3.amazonaws.com/%s", *u.bucket, storageFilepath), stat.Size(), nil
endpoint := "s3.amazonaws.com"
if u.awsConfig.Endpoint != nil {
endpoint = *u.awsConfig.Endpoint
}

return fmt.Sprintf("https://%s.%s/%s", *u.bucket, endpoint, storageFilepath), stat.Size(), nil
}

0 comments on commit ea24d03

Please sign in to comment.