Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sed-i opened this issue Sep 5, 2023 · 0 comments
Open

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

sed-i opened this issue Sep 5, 2023 · 0 comments

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant