-
Notifications
You must be signed in to change notification settings - Fork 3
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
Always return VIP as host if set #179
base: main
Are you sure you want to change the base?
Changes from 2 commits
4c534ec
586bb4a
03c5777
49ce228
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,6 @@ | |
|
||
import ops | ||
|
||
import workload | ||
|
||
HACLUSTER_RELATION_NAME = "ha" | ||
|
||
logger = logging.getLogger(__name__) | ||
|
@@ -57,11 +55,7 @@ def get_unit_juju_status(self) -> ops.StatusBase: | |
if vip and not self.charm.is_externally_accessible(event=None): | ||
return ops.BlockedStatus("vip configuration without data-integrator") | ||
|
||
if ( | ||
isinstance(self.charm.get_workload(event=None), workload.AuthenticatedWorkload) | ||
and self.charm.unit.is_leader() | ||
and vip | ||
): | ||
if self.charm.unit.is_leader() and vip: | ||
return ops.ActiveStatus(f"VIP: {vip}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if workload is not running we shouldn't set active status also follow-up to #177 (comment) also this could also be an issue for refresh, where active status with vip will block refresh status (https://github.com/canonical/charm-refresh/blob/main/docs/requirements_and_user_experience.md#lower-priority-statuses) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed ActiveStatus setting on leader unit in 49ce228 |
||
|
||
def set_vip(self, vip: Optional[str]) -> None: | ||
|
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 ha_cluster.is_clustered() is False, will router be providing a non-accessible endpoint in the databag? is that desired?
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.
+1 on that. Can this just be transient condition though?
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 change was made to support the use case where the VIP is somehow configured outside of hacluster. however, it is possible to confirm that hacluster is clustered if a relation with hacluster exists
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.
Checking
_ha_cluster.is_clustered()
only if relation with _ha_cluster exists in 03c5777