parent
c7bb288d87
commit
c59d03dfb1
|
@ -54,8 +54,8 @@ type s3Interface interface {
|
|||
|
||||
type ObjectStore struct {
|
||||
log logrus.FieldLogger
|
||||
s3 *s3.S3
|
||||
preSignS3 *s3.S3
|
||||
s3 s3Interface
|
||||
preSignS3 s3Interface
|
||||
s3Uploader *s3manager.Uploader
|
||||
kmsKeyID string
|
||||
signatureVersion string
|
||||
|
@ -203,6 +203,7 @@ func (o *ObjectStore) PutObject(bucket, key string, body io.Reader) error {
|
|||
|
||||
const notFoundCode = "NotFound"
|
||||
|
||||
// ObjectExists checks if there is an object with the given key in the object storage bucket.
|
||||
func (o *ObjectStore) ObjectExists(bucket, key string) (bool, error) {
|
||||
log := o.log.WithFields(
|
||||
logrus.Fields{
|
||||
|
|
|
@ -82,6 +82,7 @@ func TestObjectExists(t *testing.T) {
|
|||
name: "doesn't exist",
|
||||
errorResponse: awserr.New(s3.ErrCodeNoSuchKey, "no such key", nil),
|
||||
expectedExists: false,
|
||||
expectedError: "NoSuchKey: no such key",
|
||||
},
|
||||
{
|
||||
name: "error checking for existence",
|
||||
|
|
Loading…
Reference in New Issue