Skip to content

Commit

Permalink
configure containerd reigstries before waiting for microk8s on install (
Browse files Browse the repository at this point in the history
  • Loading branch information
neoaggelos authored Sep 14, 2023
1 parent e639ad1 commit 3fe1b8c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,13 @@ def on_install(self, _: InstallEvent):

self.unit.status = MaintenanceStatus("installing MicroK8s")
microk8s.install()

self.unit.status = MaintenanceStatus("initial containerd configuration")
self.config_containerd_proxy(None)
self.config_containerd_registries(None)
try:
microk8s.wait_ready()
if not isinstance(self.unit.status, BlockedStatus):
microk8s.wait_ready()
except subprocess.CalledProcessError:
LOG.exception("timed out waiting for node to come up")

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_install(role, e: Environment):

e.util.install_required_packages.assert_called_once_with()
e.microk8s.install.assert_called_once_with()
e.microk8s.set_containerd_proxy_options.assert_called_once_with(
e.microk8s.set_containerd_proxy_options.assert_called_with(
"fakehttpproxy", "fakehttpsproxy", "fakenoproxy"
)

Expand Down

0 comments on commit 3fe1b8c

Please sign in to comment.