Skip to content

Commit

Permalink
DigitalOcean: don't try to set SSE
Browse files Browse the repository at this point in the history
We lost the p.sse check in a bad merge; restoring it here.

Fix #5519
  • Loading branch information
justinsb committed Aug 15, 2018
1 parent ab1ab34 commit b73c364
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions util/pkg/vfs/s3fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,17 @@ func (p *S3Path) WriteFile(data io.ReadSeeker, aclObj ACL) error {

glog.V(4).Infof("Writing file %q", p)

// We always use server-side-encryption; it doesn't really cost us anything
sse := "AES256"

request := &s3.PutObjectInput{}
request.Body = data
request.Bucket = aws.String(p.bucket)
request.Key = aws.String(p.key)

// only support SSE if a custom endpoint is not provided
if !p.bucketDetails.defaultEncryption {
request.ServerSideEncryption = aws.String(sse)
// If we are on an S3 implementation that supports SSE, we use
// server-side-encryption, it doesn't really cost us anything. But
// if the bucket has a defaultEncryption policy instead, we honor
// that - it is likely to be a higher encryption standard.
if p.sse && !p.bucketDetails.defaultEncryption {
request.ServerSideEncryption = aws.String("AES256")
}

acl := os.Getenv("KOPS_STATE_S3_ACL")
Expand Down

0 comments on commit b73c364

Please sign in to comment.