Skip to content

Commit

Permalink
undo adding static email
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhangi-google committed Jan 17, 2025
1 parent b2f67ad commit 6108636
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
9 changes: 3 additions & 6 deletions google-cloud-storage/samples/acceptance/buckets_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,15 @@
it "get soft deleted bucket, its soft_delete_time and hard_delete_time" do
new_bucket = storage_client.create_bucket new_bucket_name
new_generation = new_bucket.generation
grant_storage_permission new_bucket_name
# Check if the bucket exist
assert(new_bucket.exists?, "Bucket #{new_bucket_name} should exist")
delete_bucket_helper new_bucket_name
# Check if the bucket does not exist
deleted_bucket =storage_client.bucket new_bucket_name
refute(deleted_bucket, "Bucket #{new_bucket_name} should not exist")
deleted_bucket= storage_client.bucket new_bucket_name, generation: new_generation, soft_deleted: true

# _out, _err = capture_io do
# get_soft_deleted_bucket bucket_name: new_bucket_name, generation: new_generation
# end
_out, _err = capture_io do
get_soft_deleted_bucket bucket_name: new_bucket_name, generation: new_generation
end
assert deleted_bucket.soft_delete_time , "Bucket soft_delete_time should be present"
assert deleted_bucket.hard_delete_time , "Bucket hard_delete_time should be present"
end
Expand Down
17 changes: 0 additions & 17 deletions google-cloud-storage/samples/acceptance/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,6 @@ def create_bucket_helper bucket_name
end
end

def grant_storage_permission bucket_name

storage_client = Google::Cloud::Storage.new
bucket= storage_client.bucket bucket_name

object_viewer = "roles/storage.objectViewer"
member = "serviceAccount:542339357638-cr0dserr2evg7sv1meghqeu703274f3h@developer.gserviceaccount.com"
bucket.policy requested_policy_version: 3 do |policy|
policy.version = 3
policy.bindings.insert(
role: object_viewer,
members: member
)
end

end

def delete_bucket_helper bucket_name
storage_client = Google::Cloud::Storage.new
retry_resource_exhaustion do
Expand Down

0 comments on commit 6108636

Please sign in to comment.