|
46 | 46 | InstallEvent, |
47 | 47 | LeaderElectedEvent, |
48 | 48 | RelationDepartedEvent, |
49 | | - SecretRemoveEvent, |
50 | 49 | StartEvent, |
51 | 50 | ) |
52 | 51 | from ops.framework import EventBase |
@@ -202,7 +201,6 @@ def __init__(self, *args): |
202 | 201 | self.framework.observe(self.on.set_password_action, self._on_set_password) |
203 | 202 | self.framework.observe(self.on.promote_to_primary_action, self._on_promote_to_primary) |
204 | 203 | self.framework.observe(self.on.update_status, self._on_update_status) |
205 | | - self.framework.observe(self.on.secret_remove, self._on_secret_remove) |
206 | 204 | self.cluster_name = self.app.name |
207 | 205 | self._member_name = self.unit.name.replace("/", "-") |
208 | 206 |
|
@@ -437,17 +435,6 @@ def get_hostname_by_unit(self, _) -> str: |
437 | 435 | # the underlying provider (LXD, MAAS, etc.), the unit IP is returned. |
438 | 436 | return self._unit_ip |
439 | 437 |
|
440 | | - def _on_secret_remove(self, event: SecretRemoveEvent) -> None: |
441 | | - # A secret removal (entire removal, not just a revision removal) causes |
442 | | - # https://github.com/juju/juju/issues/20794. This check is to avoid the |
443 | | - # errors that would happen if we tried to remove the revision in that case |
444 | | - # (in the revision removal, the label is present). |
445 | | - if event.secret.label is None: |
446 | | - logger.debug("Secret with no label cannot be removed") |
447 | | - return |
448 | | - logger.debug(f"Removing secret with label {event.secret.label} revision {event.revision}") |
449 | | - event.remove_revision() |
450 | | - |
451 | 438 | def _on_get_primary(self, event: ActionEvent) -> None: |
452 | 439 | """Get primary instance.""" |
453 | 440 | try: |
|
0 commit comments