feat: Add relation for s3 interface on the provider side - #300
Conversation
🤖 Backport labels populatedLabels to this pull request were added automatically by the When the PR is merged, backport PRs according to the labels will be automatically created. To skip the backport creation, remove any unneeded labels before merging the PR. |
There was a problem hiding this comment.
Pull request overview
This PR adds provider-side support for the s3 interface to the MinIO charm, publishing S3 connection details to related requirer applications via a new Chisme component.
Changes:
- Added
S3ProviderComponent(usingobject-storage-charmlib) to serves3-credentialsrelation data (endpoint, access key, secret key). - Added
_get_minio_endpoint()helper and unit tests covering endpoint construction and relation data publication. - Fixed a typo in integration test function names (
test_metrics_enpoint→test_metrics_endpoint).
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/components/s3_provider_component.py |
New provider component that publishes S3 connection info via the s3 interface. |
src/charm.py |
Wires the new S3 provider component and adds _get_minio_endpoint() helper. |
metadata.yaml |
Declares the new s3-credentials provided relation using interface s3. |
pyproject.toml |
Adds object-storage-charmlib dependency for charm runtime. |
tests/unit/test_charm.py |
Adds unit tests for _get_minio_endpoint() and s3-credentials relation data. |
tests/integration/test_charm.py |
Fixes test function naming typo. |
tests/integration/test_charm_ambient.py |
Fixes test function naming typo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Manos Vlassis <57320708+mvlassis@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Manos Vlassis <57320708+mvlassis@users.noreply.github.com>
theoctober19th
left a comment
There was a problem hiding this comment.
Thanks for adding me as a reviewer! I have only one question -- in the context of this charm, is it not necessary/required that this charm provides with the requirer with region, bucket, path, etc.?
Also, according to the s3 interface specification, we allow requirers to also send a custom param bucket and path in the relation data when the relation is joined. Are these info sent by requirers simply not relevant here?
Co-authored-by: Bikalpa Dhakal <theoctober19th@gmail.com> Signed-off-by: Manos Vlassis <57320708+mvlassis@users.noreply.github.com>
Summary
s3interface, using theobject-storage-charmliblibrary from https://github.com/canonical/object-storage-integrator`. Note that we will only use this here, so we don't have any reason to put this to chisme.object-storage, we usually test them on the requirer side, see https://github.com/canonical/argo-operatorsTesting
Since this relation will be mostly used to connect via the gateway mode, I tested the following manually:
minioargoCloses #299