Amir Avrahami
03/03/2022, 4:12 PMval logger = LoggerFactory.getLogger("LakeFS Integration Demo")
val s3client = AmazonS3ClientBuilder.standard()
.withEndpointConfiguration(AwsClientBuilder.EndpointConfiguration(
"<https://q73alt5prpbezujz.lakefs-demo.io>",
null
))
.withCredentials(ProfileCredentialsProvider("lakefs"))
.withClientConfiguration(PredefinedClientConfigurations.defaultConfig())
.build()
val buckets = s3client.listBuckets()
<http://logger.info|logger.info>("listBuckets(): $buckets")
val doesBucketExist = s3client.doesBucketExistV2(buckets.first().name)
<http://logger.info|logger.info>("doesBucketExistV2(): $doesBucketExist")
When I run this snippet I get a weird behaviour.
buckets
evaluates to a list of size 1 containing a bucket named my-repo
as expected.
However, doesBucketExist
evaluates to false
In addition, any other API returns 404 (bucket not found)
17:02:58.890 [main] INFO LakeFS Integration Demo - listBuckets(): [S3Bucket [name=my-repo, creationDate=Mon Feb 28 12:12:12 IST 2022, owner=null]]
17:02:59.585 [main] INFO LakeFS Integration Demo - doesBucketExistV2(): false
Might be worth mentioning that using the AWS CLI works just fine:
» aws --profile lakefs --endpoint-url <https://q73alt5prpbezujz.lakefs-demo.io> s3 ls
2022-02-28 12:12:12 my-repo
» aws --profile lakefs --endpoint-url <https://q73alt5prpbezujz.lakefs-demo.io> s3 ls <s3://my-repo>
PRE main/