From 04e0ceaefb6cf0071c84eb251606240531a84336 Mon Sep 17 00:00:00 2001 From: Tiago Reis Date: Thu, 23 May 2024 16:37:45 +0000 Subject: [PATCH] Add location arg to bucket Signed-off-by: Tiago Reis --- lib/terraspace_plugin_google/interfaces/backend.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/terraspace_plugin_google/interfaces/backend.rb b/lib/terraspace_plugin_google/interfaces/backend.rb index cf5b17b..f56a6a7 100644 --- a/lib/terraspace_plugin_google/interfaces/backend.rb +++ b/lib/terraspace_plugin_google/interfaces/backend.rb @@ -14,14 +14,15 @@ def call if exist?(bucket) logger.debug "Bucket already exist: #{bucket}" else + location = @info["location"] logger.info "Creating bucket: #{bucket}" - create_bucket(bucket) + create_bucket(bucket, location: location) end end - def create_bucket(bucket) + def create_bucket(bucket, location: nil) c = TerraspacePluginGoogle::Interfaces::Config.instance.config.gcs - storage.create_bucket(bucket) do |b| + storage.create_bucket(bucket, location: location) do |b| b.versioning = c.versioning end end