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

Provider seems to have redundant logic, cloned from the requirer #42

Closed
sed-i opened this issue Sep 5, 2023 · 1 comment
Closed

Provider seems to have redundant logic, cloned from the requirer #42

sed-i opened this issue Sep 5, 2023 · 1 comment

Comments

@sed-i
Copy link
Contributor

sed-i commented Sep 5, 2023

  • _stored gets overwritten every loop iteration.
  • Why the provider needs to extract this from relation data? Seems like this was cloned from the requirer. Not sure.

for relation in self._charm.model.relations[self._relation_name]:
if not relation.app:
self._stored.external_host = ""
self._stored.scheme = ""
return
external_host = relation.data[relation.app].get("external_host", "")
self._stored.external_host = external_host or self._stored.external_host
scheme = relation.data[relation.app].get("scheme", "")
self._stored.scheme = scheme or self._stored.scheme

Originally posted in canonical/traefik-k8s-operator#234 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants