Aiven-Open / tiered-storage-for-apache-kafka

RemoteStorageManager for Apache Kafka® Tiered Storage
Apache License 2.0
91 stars 19 forks source link

fix: capture GCS metrics when bucket contains hyphens #420

Closed jeqo closed 11 months ago

jeqo commented 11 months ago

GCS bucket names can contain hyphens, underscores, dots, etc: https://cloud.google.com/storage/docs/buckets

Fixing the regex to match URLs, and a couple of minor related refactoring. See commits for details.

jeqo commented 11 months ago

Weirdly enough, seems that the GCS Fake Server doesn't allow these characters on the bucket name, so I wasn't able to change the test; but tried it manually on our demo where it wasn't working.

jeqo commented 11 months ago

Thanks @ivanyu, suggestion makes sense. Adding a test case for the regex at least so we can validate the expressions.