Skip to content

Commit

Permalink
fix check containerd availability command p3
Browse files Browse the repository at this point in the history
  • Loading branch information
Imadzuma committed Nov 27, 2024
1 parent 99ed35e commit 63da01b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions kubemarine/cri/containerd.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def get_config_path(inventory: dict) -> Optional[str]:
return config_path


def configure_containerd(group: NodeGroup) -> RunnersGroupResult:
def configure_containerd(group: NodeGroup, wait_restart=False) -> RunnersGroupResult:
cluster = group.cluster
log = cluster.log

Expand Down Expand Up @@ -303,9 +303,9 @@ def configure_containerd(group: NodeGroup) -> RunnersGroupResult:
node.sudo(
f"chmod 600 {os_specific_associations['config_location']} && "
f"sudo systemctl restart {os_specific_associations['service_name']} && "
f"systemctl status {os_specific_associations['service_name']} && "
f"timeout 10 sh -c 'until sudo crictl version 2>&1; do sleep 1; done' "
, callback=collector)
f"systemctl status {os_specific_associations['service_name']}", callback=collector)
if wait_restart:
node.sudo( f"timeout 60 sh -c 'until sudo crictl version 2>&1; do sleep 1; done' ", callback=collector)
return collector.result


Expand Down
2 changes: 1 addition & 1 deletion kubemarine/kubernetes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ def upgrade_cri_if_required(group: NodeGroup) -> None:

# upgrade of sandbox_image is currently not supported for migrate_kubemarine
if cluster.context["upgrade"]["required"].get('containerdConfig', False):
containerd.configure_containerd(group)
containerd.configure_containerd(group, wait_restart=True)
else:
log.debug("'containerd' configuration upgrade is not required")

Expand Down

0 comments on commit 63da01b

Please sign in to comment.