Add a config option for relaxed s3 bucket names.

Closes-Bug: #1926498
Change-Id: I4b329f3327a0e91ccd9f65841cc5d62736918a85
This commit is contained in:
Ethan Myers 2022-05-13 14:14:29 -06:00 committed by Ethan Myers
parent b069b3aa4c
commit 2bda1f68a6
4 changed files with 17 additions and 0 deletions

View File

@ -122,6 +122,16 @@ options:
that once a pool has been created, changes to this setting will be
ignored. Setting this value to -1, enables the number of placement
groups to be calculated based on the Ceph placement group calculator.
relaxed-s3-bucket-names:
type: boolean
default: false
description: |
Enables relaxed S3 bucket names rules for US region buckets. This
allows for bucket names with any combination of letters, numbers,
periods, dashes and underscores up to 255 characters long, as long
as bucket names are unique and not formatted as IP addresses.
https://docs.ceph.com/en/latest/radosgw/s3/bucketops/
pool-type:
type: string
default: replicated

View File

@ -292,6 +292,7 @@ class MonContext(context.CephContext):
'unit_public_ip': unit_public_ip(),
'fsid': fsid,
'rgw_swift_versioning': config('rgw-swift-versioning-enabled'),
'relaxed_s3_bucket_names': config('relaxed-s3-bucket-names'),
'frontend': http_frontend,
}

View File

@ -15,6 +15,7 @@ debug rgw = {{ loglevel }}/5
ms bind ipv6 = true
{% endif %}
rgw swift versioning enabled = {{ rgw_swift_versioning }}
rgw relaxed s3 bucket names = {{ relaxed_s3_bucket_names }}
{% if global -%}
# The following are user-provided options provided via the config-flags charm option.
# User-provided [global] section config

View File

@ -119,6 +119,7 @@ class MonContextTest(CharmTestCase):
'fsid': 'testfsid',
'rgw_swift_versioning': False,
'frontend': 'beast',
'relaxed_s3_bucket_names': False
}
self.assertEqual(expect, mon_ctxt())
self.assertFalse(mock_ensure_rsv_v6.called)
@ -169,6 +170,7 @@ class MonContextTest(CharmTestCase):
'fsid': 'testfsid',
'rgw_swift_versioning': False,
'frontend': 'beast',
'relaxed_s3_bucket_names': False,
}
self.assertEqual(expect, mon_ctxt())
self.assertFalse(mock_ensure_rsv_v6.called)
@ -228,6 +230,7 @@ class MonContextTest(CharmTestCase):
'fsid': 'testfsid',
'rgw_swift_versioning': False,
'frontend': 'beast',
'relaxed_s3_bucket_names': False,
}
self.assertEqual(expect, mon_ctxt())
@ -269,6 +272,7 @@ class MonContextTest(CharmTestCase):
'fsid': 'testfsid',
'rgw_swift_versioning': False,
'frontend': 'beast',
'relaxed_s3_bucket_names': False,
}
self.assertEqual(expect, mon_ctxt())
@ -368,6 +372,7 @@ class MonContextTest(CharmTestCase):
'fsid': 'testfsid',
'rgw_swift_versioning': False,
'frontend': 'beast',
'relaxed_s3_bucket_names': False,
}
self.assertEqual(expect, mon_ctxt())