Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
Merge the relation data from all kube-control endpoints rather than c…
Browse files Browse the repository at this point in the history
…ounting only on the first endpoint
  • Loading branch information
addyess committed Nov 15, 2022
1 parent 676ab9c commit e390f43
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ops/ops/interface_kube_control/requires.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit e390f43

Please sign in to comment.