diff --git a/docs/reference/charm-architecture.md b/docs/reference/charm-architecture.md index 5de089b..ccbabb3 100644 --- a/docs/reference/charm-architecture.md +++ b/docs/reference/charm-architecture.md @@ -2,7 +2,7 @@ ​The Pollen operator is a machine charm designed to deploy and manage Pollen directly on VMs and bare metal. [Pollen](https://github.com/dustinkirkland/pollen) is a high-performance, scalable, free web server that provides "Entropy-as-a-Service" by offering small strings of entropy over both HTTPS and clear-text HTTP connections. -This charm does not use an OCI image, as it runs directly on a machine rather than in a container. The charm uses the [pollen](https://github.com/canonical/pollen/blob/main/snap/snapcraft.yaml) [snap](https://ubuntu.com/core/docs/snaps-in-ubuntu-core) to install Pollen during deployment. +This charm does not use an OCI image, as it runs directly on a machine rather than in a container. The charm uses the [pollen](https://github.com/canonical/pollen/blob/main/snap/snapcraft.yaml) [snap](https://snapcraft.io/pollen) to install Pollen during deployment. Canonical provides a Pollen server as a service to the Ubuntu community at `https://entropy.ubuntu.com`. diff --git a/src/charm.py b/src/charm.py index 0b8d25c..c4095ee 100755 --- a/src/charm.py +++ b/src/charm.py @@ -83,6 +83,7 @@ def _on_upgrade_charm(self, event: ops.UpgradeCharmEvent): """ self.unit.status = MaintenanceStatus("Upgrading dependencies") self.pollen.prepare(self.unit.name) + self.pollen.start() self.unit.status = ActiveStatus() def _on_start(self, event: ops.StartEvent): diff --git a/src/pollen.py b/src/pollen.py index 2a99f38..651c9d3 100644 --- a/src/pollen.py +++ b/src/pollen.py @@ -2,7 +2,6 @@ # See LICENSE file for licensing details. """Pollen charm business logic.""" - import glob from pathlib import Path @@ -13,8 +12,8 @@ from charm_state import HTTP_PORT from exceptions import ConfigurationWriteError, InstallError -# This will be changed to 'pollen' once the upstream snap location is updated. -SNAP_NAME = "gtrkiller-pollen" +OLD_SNAP_NAME = "gtrkiller-pollen" +SNAP_NAME = "pollen" RNG_FILE_VALUE = 'RNGDOPTIONS="--fill-watermark=90% --feed-interval=1"' @@ -31,8 +30,10 @@ def prepare(self, unit_name) -> None: InstallError: if the snap fails to install ConfigurationWriteError: something went wrong writing the configuration """ + # Ensure that the old snap is not installed. + snap.remove(OLD_SNAP_NAME) try: - snap.add(SNAP_NAME, channel="candidate") + snap.add(SNAP_NAME, channel="stable") except snap.SnapError as exc: raise InstallError from exc unit_name = unit_name.replace("/", "-")