osbuild-upload-generic-s3: exit(1) on error
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
c9f3777f2a
commit
1c3fe82d1e
1 changed files with 3 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ package main
|
|||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
|
||||
|
|
@ -35,13 +36,13 @@ func main() {
|
|||
a, err := awscloud.NewForEndpoint(endpoint, region, accessKeyID, secretAccessKey, sessionToken, caBundle, skipSSLVerification)
|
||||
if err != nil {
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
uploadOutput, err := a.Upload(filename, bucketName, keyName)
|
||||
if err != nil {
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
fmt.Printf("file uploaded to %s\n", aws.StringValue(&uploadOutput.Location))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue