-
Notifications
You must be signed in to change notification settings - Fork 5
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
[DPE-3451][DPE-3452] Expose pgbouncer #137
Conversation
35df0b3
to
e03b938
Compare
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.
Copy of the data integrator with the expose flag requested.
if tls: | ||
sslmode = "require" | ||
else: | ||
sslmode = "disable" |
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 will work with TLS enabled as well.
# TODO remove hotpatching when data-integrator implements its side of the replation | ||
await ops_test.model.wait_for_idle(apps=[DATA_INTEGRATOR_APP_NAME]) | ||
await _update_file( | ||
ops_test, | ||
"./lib/charms/data_platform_libs/v0/data_interfaces.py", | ||
"lib/charms/data_platform_libs/v0/data_interfaces.py", | ||
) | ||
await _update_file( | ||
ops_test, | ||
"./tests/integration/relations/pgbouncer_provider/data_integrator_charm.py", | ||
"src/charm.py", | ||
) |
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.
Replace the data_interfaces
and charm code on the data-integrator units, so that we can implement the interface in the mean time.
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.
Q: why did you go with "mission impossible"-style of live data-integrator
charm patching instead of PR data-intgrator charms? :-)
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.
Mostly methods required by the Postgresql TLS charm lib.
key, ca, cert = self.tls.get_tls_files() | ||
if key is not None: | ||
self.render_file( | ||
f"{PGB_CONF_DIR}/{self.app.name}/{TLS_KEY_FILE}", |
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.
We should use the app specific config dir, in case of multiple subordinates in the same principle.
@pytest.mark.group(1) | ||
async def test_relation_with_data_integrator(ops_test: OpsTest): | ||
"""Test that the charm can be related to the data integrator without extra user roles.""" | ||
config = {"database-name": "test-database"} | ||
await ops_test.model.deploy( | ||
DATA_INTEGRATOR_APP_NAME, | ||
channel="edge", | ||
config=config, | ||
) | ||
await ops_test.model.add_relation(f"{PGB}:database", DATA_INTEGRATOR_APP_NAME) | ||
async with ops_test.fast_forward(): | ||
await ops_test.model.wait_for_idle(status="active") |
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.
Moved to its own suite.
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.
LGTM! Just let's wait 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.
LGTM for the code and test. Well done!
P.S. for me your approach with livepatching data-integrator is crazy... IMHO invest 3 hours to improve data-integrator and remove livepatching-blackmagic from here. Tnx!
# TODO remove hotpatching when data-integrator implements its side of the replation | ||
await ops_test.model.wait_for_idle(apps=[DATA_INTEGRATOR_APP_NAME]) | ||
await _update_file( | ||
ops_test, | ||
"./lib/charms/data_platform_libs/v0/data_interfaces.py", | ||
"lib/charms/data_platform_libs/v0/data_interfaces.py", | ||
) | ||
await _update_file( | ||
ops_test, | ||
"./tests/integration/relations/pgbouncer_provider/data_integrator_charm.py", | ||
"src/charm.py", | ||
) |
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.
Q: why did you go with "mission impossible"-style of live data-integrator
charm patching instead of PR data-intgrator charms? :-)
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.
Great updates!
3398218
to
19297a1
Compare
196a805
to
a23bdad
Compare
a23bdad
to
e40574a
Compare
data-integrator
for integration tests