Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add location arg to bucket backend setup #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/terraspace_plugin_google/interfaces/backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down