Adapt to presentation of IP addresses
Not all clients can use hostnames for OVS DB URL's so changes in this area have been reverted/adapted. The OVN relay can so ensure it uses the new context properties for hostname based URL's. Depends-On: Iefe8ad601b305e3fdab7548e1d3357493491d3e9 Change-Id: I5a03590946099b50651570f411f0c6cc3a13f115
This commit is contained in:
@@ -37,7 +37,7 @@ LIBAPI = 0
|
||||
|
||||
# Increment this PATCH version before using `charmcraft publish-lib` or reset
|
||||
# to 0 if you are raising the major API version
|
||||
LIBPATCH = 2
|
||||
LIBPATCH = 3
|
||||
|
||||
|
||||
# TODO: add your code here! Happy coding!
|
||||
@@ -104,8 +104,11 @@ class OVSDBCMSRequires(Object):
|
||||
def bound_hostnames(self):
|
||||
return self.get_all_unit_values("bound-hostname")
|
||||
|
||||
def bound_addresses(self):
|
||||
return self.get_all_unit_values("bound-address")
|
||||
|
||||
def remote_ready(self):
|
||||
return all(self.bound_hostnames())
|
||||
return all(self.bound_hostnames()) or all(self.bound_addresses())
|
||||
|
||||
def _on_ovsdb_cms_relation_changed(self, event):
|
||||
"""OVSDBCMS relation changed."""
|
||||
@@ -201,5 +204,3 @@ class OVSDBCMSProvides(Object):
|
||||
for relation in relations:
|
||||
for k, v in settings.items():
|
||||
relation.data[self.model.unit][k] = v
|
||||
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ class OVNRelayOperatorCharm(ovn_charm.OSBaseOVNOperatorCharm):
|
||||
@property
|
||||
def southbound_db_url(self) -> str:
|
||||
"""Full connection URL for Southbound DB relay."""
|
||||
return f"ssl:{self.ingress_address}:6442"
|
||||
return f"ssl:{self.ingress_address}:6642"
|
||||
|
||||
def get_pebble_handlers(self):
|
||||
pebble_handlers = [
|
||||
|
||||
@@ -14,7 +14,7 @@ function stop_svc()
|
||||
}
|
||||
|
||||
log_msg "Starting"
|
||||
REMOTES={{ ovsdb_cms.db_sb_connection_strs }}
|
||||
REMOTES={{ ovsdb_cms.db_sb_connection_hostname_strs }}
|
||||
|
||||
ovsdb-server \
|
||||
-vconsole:emer \
|
||||
|
||||
@@ -66,6 +66,6 @@ class TestOVNRelayXenaOperatorCharm(test_utils.CharmTestCase):
|
||||
|
||||
def test_southbound_db_url(self):
|
||||
self.assertEqual(
|
||||
'ssl:10.0.0.10:6442',
|
||||
'ssl:10.0.0.10:6642',
|
||||
self.harness.charm.southbound_db_url
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user