Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(node-installer): #153 conditionally restart k0s controller service when present #167

Merged
Merged
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
7 changes: 6 additions & 1 deletion node-installer/script/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ if [ ! -f $NODE_ROOT$KWASM_DIR/active ]; then
elif $IS_RKE2_AGENT; then
nsenter --target 1 --mount --uts --ipc --net -- systemctl restart rke2-agent
elif $IS_K0S_WORKER; then
nsenter -m/$NODE_ROOT/proc/1/ns/mnt -- systemctl restart k0sworker
svc_name=k0sworker
if ! systemctl list-units | grep -q $svc_name; then
svc_name=k0scontroller
fi

nsenter -m/$NODE_ROOT/proc/1/ns/mnt -- systemctl restart $svc_name
elif ls $NODE_ROOT/etc/init.d/containerd > /dev/null 2>&1 ; then
nsenter --target 1 --mount --uts --ipc --net -- /etc/init.d/containerd restart
else
Expand Down