Skip to content

Commit 14cb47e

Browse files
committed
Revert "DPE-8395 Remove old revision of Juju Secret (#1195)"
This reverts commit 27c5225. Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
1 parent 5870ee7 commit 14cb47e

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/charm.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
InstallEvent,
4747
LeaderElectedEvent,
4848
RelationDepartedEvent,
49-
SecretRemoveEvent,
5049
StartEvent,
5150
)
5251
from ops.framework import EventBase
@@ -202,7 +201,6 @@ def __init__(self, *args):
202201
self.framework.observe(self.on.set_password_action, self._on_set_password)
203202
self.framework.observe(self.on.promote_to_primary_action, self._on_promote_to_primary)
204203
self.framework.observe(self.on.update_status, self._on_update_status)
205-
self.framework.observe(self.on.secret_remove, self._on_secret_remove)
206204
self.cluster_name = self.app.name
207205
self._member_name = self.unit.name.replace("/", "-")
208206

@@ -437,17 +435,6 @@ def get_hostname_by_unit(self, _) -> str:
437435
# the underlying provider (LXD, MAAS, etc.), the unit IP is returned.
438436
return self._unit_ip
439437

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-
451438
def _on_get_primary(self, event: ActionEvent) -> None:
452439
"""Get primary instance."""
453440
try:

0 commit comments

Comments
 (0)