Skip to content

Commit

Permalink
Fix create Gcs bucket method (#444)
Browse files Browse the repository at this point in the history
* Fix create Gcs bucket method

* Use .contains(bucket) instead of .find
  • Loading branch information
audkar authored and bootstraponline committed Jan 8, 2019
1 parent 7b32ae9 commit 2989335
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion release_notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## v4.2.0 (unreleased)

- TODO
- Fix create Gcs bucket [#444](https://github.com/TestArmada/flank/pull/444)

## v4.1.1

Expand Down
5 changes: 2 additions & 3 deletions test_runner/src/main/kotlin/ftl/args/ArgsHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,10 @@ object ArgsHelper {

val bucketListOption = Storage.BucketListOption.prefix(bucket)
val storageList = storage.list(bucketListOption).values?.map { it.name } ?: emptyList()
val targetBucket = storageList.find { it == bucket }
if (targetBucket != null) return targetBucket
if (storageList.contains(bucket)) return bucket

return storage.create(
BucketInfo.newBuilder(targetBucket)
BucketInfo.newBuilder(bucket)
.setStorageClass(StorageClass.REGIONAL)
.setLocation(storageLocation)
.setLabels(bucketLabel)
Expand Down

0 comments on commit 2989335

Please sign in to comment.