diff --git a/.github/workflows/helm-chart-smoketest.yml b/.github/workflows/helm-chart-smoketest.yml index caf30d9c..7ce4cde8 100644 --- a/.github/workflows/helm-chart-smoketest.yml +++ b/.github/workflows/helm-chart-smoketest.yml @@ -172,8 +172,6 @@ jobs: run: kubectl label node --all spin=true - name: verify only one installer pod with Succeeded status - # TODO: provisioning on k3d still leads to the first installer pod finishing with provisioner status Unknown and phase Failed - if: matrix.config.type != 'k3d' run: | timeout 60s bash -c 'until [[ "$(kubectl -n rcm get $(kubectl get pods -n rcm --no-headers -o name | grep install | head -n1) -o jsonpath="{.status.phase}" 2>/dev/null)" == "Succeeded" ]]; do sleep 2; done' @@ -201,8 +199,7 @@ jobs: kubectl describe runtimeclass wasmtime-spin-v2 # Get install pod logs - # Note: there may be multiple pods pending k3d fix for issue https://github.com/spinframework/runtime-class-manager/issues/393 - install_pod=$(kubectl get pods -n rcm --no-headers -o name | awk '{if ($1 ~ "-spin-v2-install") print $0}' | tail -n 1) + install_pod=$(kubectl get pods -n rcm --no-headers -o name | awk '{if ($1 ~ "-spin-v2-install") print $0}') kubectl describe -n rcm $install_pod || true kubectl logs -n rcm -c downloader $install_pod || true kubectl logs -n rcm -c provisioner $install_pod || true diff --git a/internal/containerd/restart_unix.go b/internal/containerd/restart_unix.go index db57770e..6803df93 100644 --- a/internal/containerd/restart_unix.go +++ b/internal/containerd/restart_unix.go @@ -96,21 +96,13 @@ func (c K3sRestarter) Restart() error { return fmt.Errorf("unable to restart k3s: %w", err) } } else { - // TODO: this approach still leads to the behavior mentioned in https://github.com/spinframework/runtime-class-manager/issues/140: - // The first pod's provisioner container exits with code 255, leading to pod status Unknown, - // followed by the subsequent pod's provisioner container no-op-ing and finishing with status Completed. - pid, err := getPid("k3s") - if err != nil { - return err - } - slog.Debug("found k3s process", "pid", pid) - - err = syscall.Kill(pid, syscall.SIGHUP) + // PID 1 inside the k3d node container is the k3s process. + out, err := nsenterCmd("kill", "-s", "TERM", "1").CombinedOutput() + slog.Debug(string(out)) if err != nil { - return fmt.Errorf("failed to send SIGHUP to k3s: %w", err) + return fmt.Errorf("unable to restart k3s via TERM signal: %w", err) } } - return nil }