-
Notifications
You must be signed in to change notification settings - Fork 28
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
[IPA] Make sure ingress.url
returns an up-to-date value
#84
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the return type change in 'url'?
That's a backwards-incompatible change. What if user code is doing if self.ipa.url is None...
?
self.assertEqual(self.harness.charm.ipa.url, "http://a.b/c") | ||
|
||
# THEN the ready event is emitted | ||
after = self.harness.charm.ready_event_count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems like a good place to use https://discourse.charmhub.io/t/harness-recipe-capture-events/6581
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. This is magic!
Agreeing with @PietroPasotti here. I get that the behavior is equivalent in case of |
lib/charms/traefik_k8s/v1/ingress.py
Outdated
def url(self) -> str: | ||
"""The full ingress URL to reach the current unit. | ||
|
||
May return None if the URL isn't available yet. | ||
""" | ||
data = self._stored.current_url or "" # type: ignore | ||
assert isinstance(data, str) # for static checker | ||
return data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this method "May return None", shouldn't be the return type Optional[str]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Thanks for the reviews! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work!
An IPA analogue to #80.
Context
canonical/alertmanager-k8s-operator#94
Release Notes
[IPA] Make sure
ingress.url
returns an up-to-date value