refactor(refresh): use the refresh module from the single kernel library - #1942
Draft
marceloneppel wants to merge 1 commit into
Draft
refactor(refresh): use the refresh module from the single kernel library#1942marceloneppel wants to merge 1 commit into
marceloneppel wants to merge 1 commit into
Conversation
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Part of the refresh module migration into the single kernel library (canonical/postgresql-single-kernel-library).
Solution
The VM charm now consumes the library's
RefreshManagerinstead of owning its own refresh plumbing:_PostgreSQLRefreshclass and the refresh-only helpers (_post_snap_refresh,_reconcile_refresh_status,_check_and_update_internal_cert,_migrate_temp_tablespace_location,_execute_temp_tablespace_migration,_resolve_primary_host) are deleted — they now live in the library.collect-unit-statusobserver targets the manager's status reconciliation, keeping the refresh status gate and the "do not use collect status events elsewhere" contract intact.RefreshManager.on_init().set_unit_statusdelegates to the manager, and arefreshproperty keepswatcher.pyandasync_replication.pyworking unchanged.post_refresh_side_effectsbridge, alongside the other duck-typed bridge methods (set_default_unit_status,set_app_status,get_async_primary_cluster_endpoint,has_async_replication_relation,update_relation_endpoints).Unit tests that exercised the charm-side helpers are repointed at the manager's equivalents.
Checklist