Skip to content

Instantly share code, notes, and snippets.

@dimaqq
Created September 4, 2025 09:57
Show Gist options
  • Select an option

  • Save dimaqq/d8b55285b08b872327041f44bf742895 to your computer and use it in GitHub Desktop.

Select an option

Save dimaqq/d8b55285b08b872327041f44bf742895 to your computer and use it in GitHub Desktop.
def reconcile(self, event: Any):
secret = self.model.get_secret(...)
passwd = secret.get_content(refresh=True)
reldata = self.foo_requirer.get_foobar()
try:
self.workload.reconfigure_and_restart(
redata,
passwd,
...
)
self.unit.status = ops.ActiveStatus()
except NotSafeToRestartWorkloadNow:
self.unit.status = ops.ActiveStatus("Degraded: will restart workload later")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment