Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference/charm-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
1 change: 1 addition & 0 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
9 changes: 5 additions & 4 deletions src/pollen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# See LICENSE file for licensing details.

"""Pollen charm business logic."""

import glob
from pathlib import Path

Expand All @@ -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"'


Expand All @@ -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("/", "-")
Expand Down
Loading