osbuild-upload-generic-s3: exit(1) on error

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2022-08-15 15:10:02 +02:00 committed by Sanne Raymaekers
parent c9f3777f2a
commit 1c3fe82d1e

View file

@ -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))