From 2f7e654f462b4a25c552ca299363019b0270c48c Mon Sep 17 00:00:00 2001 From: Patricia Reinoso Date: Wed, 18 Sep 2024 11:51:29 +0000 Subject: [PATCH] fix hook failure when multus is not enabled --- CONTRIBUTING.md | 2 +- src/charm.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 65cc0ba9..a7da2ff8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,7 @@ sudo microk8s enable multus Install Juju and bootstrap a controller on the MicroK8S instance: ```shell -sudo snap install juju --channel=3.1/stable +sudo snap install juju --channel=3.4/stable juju bootstrap microk8s ``` diff --git a/src/charm.py b/src/charm.py index 9ffec555..9d440e66 100755 --- a/src/charm.py +++ b/src/charm.py @@ -570,6 +570,8 @@ def _on_bessd_pebble_ready(self, _: EventBase) -> None: return if not self._hugepages_are_available(): return + if not self._kubernetes_multus.multus_is_available(): + return if not self._kubernetes_multus.is_ready(): return if not path_exists(container=self._bessd_container, path=BESSD_CONTAINER_CONFIG_PATH):