From 94408f85e2493ed2dc099767d33949d020032906 Mon Sep 17 00:00:00 2001 From: Smail KOURTA Date: Sat, 26 Oct 2024 07:12:24 +0000 Subject: [PATCH] fix for s3 secret ids --- .../opensearch/v0/opensearch_relation_peer_cluster.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/charms/opensearch/v0/opensearch_relation_peer_cluster.py b/lib/charms/opensearch/v0/opensearch_relation_peer_cluster.py index 3f68d828f..6f74f4229 100644 --- a/lib/charms/opensearch/v0/opensearch_relation_peer_cluster.py +++ b/lib/charms/opensearch/v0/opensearch_relation_peer_cluster.py @@ -595,7 +595,11 @@ def _grant_rel_data_secrets( for rel_id in all_rel_ids: if relation := self.get_rel(rel_id=rel_id): - self.secrets.grant_secret_to_relation(secret_id, relation) + if key == "s3": + self.secrets.grant_secret_to_relation(secret_id["access_key"], relation) + self.secrets.grant_secret_to_relation(secret_id["secret_key"], relation) + else: + self.secrets.grant_secret_to_relation(secret_id, relation) class OpenSearchPeerClusterRequirer(OpenSearchPeerClusterRelation):