From e390f43db83217e5c03b75674dc6d0e96ef11bc3 Mon Sep 17 00:00:00 2001 From: Adam Dyess Date: Tue, 15 Nov 2022 16:16:55 -0600 Subject: [PATCH] Merge the relation data from all kube-control endpoints rather than counting only on the first endpoint --- ops/ops/interface_kube_control/requires.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ops/ops/interface_kube_control/requires.py b/ops/ops/interface_kube_control/requires.py index 4bba6e1..793cd65 100644 --- a/ops/ops/interface_kube_control/requires.py +++ b/ops/ops/interface_kube_control/requires.py @@ -41,8 +41,10 @@ def relation(self) -> Optional[Relation]: @cached_property def _data(self) -> Optional[Data]: if self.relation and self.relation.units: - raw_data = self.relation.data[list(self.relation.units)[0]] - return Data(**raw_data) + rx = {} + for unit in self.relation.units: + rx.update(self.relation.data[unit]) + return Data(**rx) return None def evaluate_relation(self, event) -> Optional[str]: