Skip to content

Commit

Permalink
don't restart the charm on update-status, use package version 1.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanhphan1147 committed Mar 15, 2024
1 parent cfba9c4 commit 04ebcd5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,8 @@ def _on_update_status(self, _: ops.UpdateStatusEvent) -> None:
Raises:
RuntimeError: when the service is not running.
"""
logger.info("Recalculating charm status")
if self.model.get_relation(AGENT_RELATION) and not self.jenkins_agent_service.is_active:
logger.error("agent related to Jenkins but service is not active")
self.restart_agent_service()
raise RuntimeError("jenkins-agent service is not running")

if not self.model.get_relation(AGENT_RELATION):
Expand Down
2 changes: 1 addition & 1 deletion src/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

logger = logging.getLogger(__name__)
AGENT_SERVICE_NAME = "jenkins-agent"
APT_PACKAGE_VERSION = "1.0.6"
APT_PACKAGE_VERSION = "1.0.7"
APT_PACKAGE_NAME = f"jenkins-agent-{APT_PACKAGE_VERSION}"
SYSTEMD_SERVICE_CONF_DIR = "/etc/systemd/system/jenkins-agent.service.d/"
PPA_URI = "https://ppa.launchpadcontent.net/canonical-is-devops/jenkins-agent-charm/ubuntu/"
Expand Down

0 comments on commit 04ebcd5

Please sign in to comment.