mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 17:26:28 +00:00
gcp: check if bucket exists after client creation
Signed-off-by: Eric Briand <eric.briand@gmail.com>
This commit is contained in:
parent
b15d0963f4
commit
0c6a059f71
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user