Closed sed-i closed 1 year ago
@rbarry82 I recall discussing a revoked
event for traefik-route.
Was there a reason not to have it?
Hmm ok looks like the terminology is more subtle:
Grafana wouldn't actually care about that event anyway (either the relation exists and it's the leader, or not -- the "leader only ingress" flow is uglier, since it also relies on leader electon/etc). The patch as it exists here is probably sufficient alongside observing it in Traefik.
Is this the cause of the 404?
Grafana wouldn't actually care about that event anyway
This change is on the provider side - it's for traefik charm code to observe and wipe the yaml file associated with the relation.
Is this the cause of the 404?
No, the 404 is because of a missing TLS section in the route config (separate issue).
This seems like a good change. When I wrote route I didn't see the need for observing the removed event, but if traefik needs to clean up some files after a remote end leaves, then yes, this sounds like the way to do it.
Re the _wipe_ingress_for_relation early return, that also seems like an oversight. IIRC I added that check because that routine also attempts to wipe the relation databag, which if we're in a relation-broken context, might fail. So the proper solution to that issue is to clean up the traefik config files, but skip the databag wipe if we're answering a relation-broken.
Is this a draft still?
Still a draft?
Added utest. Ready for review.
When grafana is re-related to traefik, traefik doesn't wipe the old yaml.
In the following example, the traefik container has yaml files for relations 5 and 8, even though relation 5 doesn't exist anymore:
And traefik gently complains:
This PR adds a
revoked
event so that it could be handled similarly to ipa and ipu from within traefik:Side note: currently it seems that
_wipe_ingress_for_relation
never takes place on relation removal. Seems like this is a mistake.