mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 17:26:28 +00:00
commit
305aa129d2
@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@ -69,9 +68,9 @@ func pushAWS(args []string) {
|
|||||||
name = filepath.Base(name)
|
name = filepath.Base(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
content, err := ioutil.ReadAll(f)
|
fi, err := f.Stat()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Error reading file: %v", err)
|
log.Fatalf("Error reading file information: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
dst := name + filepath.Ext(path)
|
dst := name + filepath.Ext(path)
|
||||||
@ -79,7 +78,7 @@ func pushAWS(args []string) {
|
|||||||
Bucket: aws.String(bucket),
|
Bucket: aws.String(bucket),
|
||||||
Key: aws.String(dst),
|
Key: aws.String(dst),
|
||||||
Body: f,
|
Body: f,
|
||||||
ContentLength: aws.Int64(int64(len(content))),
|
ContentLength: aws.Int64(fi.Size()),
|
||||||
ContentType: aws.String("application/octet-stream"),
|
ContentType: aws.String("application/octet-stream"),
|
||||||
}
|
}
|
||||||
log.Debugf("PutObject:\n%v", putParams)
|
log.Debugf("PutObject:\n%v", putParams)
|
||||||
|
Loading…
Reference in New Issue
Block a user