mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-02 23:47:11 +00:00
gcp: check if bucket exists after client creation
Signed-off-by: Eric Briand <eric.briand@gmail.com>
This commit is contained in:
@@ -52,15 +52,15 @@ func pushGcp(args []string) {
|
||||
name = filepath.Base(name)
|
||||
}
|
||||
|
||||
if bucket == "" {
|
||||
log.Fatalf("Please specify the bucket to use")
|
||||
}
|
||||
|
||||
client, err := NewGCPClient(keys, project)
|
||||
if err != nil {
|
||||
log.Fatalf("Unable to connect to GCP: %v", err)
|
||||
}
|
||||
|
||||
if bucket == "" {
|
||||
log.Fatalf("Please specify the bucket to use")
|
||||
}
|
||||
|
||||
err = client.UploadFile(path, name+suffix, bucket, public)
|
||||
if err != nil {
|
||||
log.Fatalf("Error copying to Google Storage: %v", err)
|
||||
|
Reference in New Issue
Block a user