Skip to content

Commit

Permalink
reconcile on more cases
Browse files Browse the repository at this point in the history
  • Loading branch information
javierdelapuente committed Jan 31, 2025
1 parent 8a59b7b commit fdd2b85
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,18 +340,22 @@ def _on_config_changed(self, _: ConfigChangedEvent) -> None:
state = self._setup_state()
self._set_reconcile_timer()

flush_and_reconcile = False
if state.charm_config.token != self._stored.token:
self._stored.token = None
flush_and_reconcile = True
if self.config[PATH_CONFIG_NAME] != self._stored.path:
self._stored.path = self.config[PATH_CONFIG_NAME]
flush_and_reconcile = True
if self.config[LABELS_CONFIG_NAME] != self._stored.labels:
self._stored.labels = self.config[LABELS_CONFIG_NAME]
flush_and_reconcile = True

state = self._setup_state()

if not self._get_set_image_ready_status():
return
if state.charm_config.token != self._stored.token:
if flush_and_reconcile:
logger.info("JAVI CHARM _ON_CONFIG_CHANGED FLUSH RECONCILE")
runner_scaler = self._get_runner_scaler(state)
runner_scaler.flush(flush_mode=FlushMode.FLUSH_IDLE)
Expand Down

0 comments on commit fdd2b85

Please sign in to comment.