Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/helm-chart-smoketest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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
Expand Down
16 changes: 4 additions & 12 deletions internal/containerd/restart_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Loading