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

fixed some issues when removing an ingress relation #282

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

PietroPasotti
Copy link
Collaborator

Issue

When removing a relation between traefik and, say, alertmanager, traefik goes into error state because it fails to wipe the relation databags due to some permission error.

Solution: be more careful with databag cleanup.

@@ -890,7 +900,15 @@ def _wipe_ingress_for_relation(self, relation: Relation, *, wipe_rel_data=True):
# Skip this for traefik-route because it doesn't have a `wipe_ingress_data` method.
provider = self._provider_from_relation(relation)
if wipe_rel_data and self.unit.is_leader() and provider != self.traefik_route:
provider.wipe_ingress_data(relation) # type: ignore # this is an ingress-type relation
try:
provider.wipe_ingress_data(relation) # type: ignore # this is an ingress-type relation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it work if we do nothing for relation broken?
Juju takes care of the databag - we probably shouldn't worry about cleanup.

Seems wrong to log an ERROR with a reservation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmm, true, not sure what's the goal semantically of wiping the databags. historically traefik's been doing it forever, it's just habit now.
@simskij perhaps has some context?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps it's a way for the charm to mark for itself that the relation is going away and should not be used.

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

Successfully merging this pull request may close these issues.

None yet

2 participants