Files
k3s-ansible/.github/scripts/test-k3s-server-bootstrap.sh
Timothy Stewart 4c50fbbe10 fix(k3s-server): stabilize single-server bootstrap
- delegate cgroups for transient K3s server units\n- verify inventory node registration without legacy role labels\n- wait for bootstrap CRDs before replacing the transient service
2026-08-01 12:27:12 -05:00

36 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -Eeuo pipefail
repo_root="$(git rev-parse --show-toplevel)"
main_tasks="$repo_root/roles/k3s_server/tasks/main.yml"
join_tasks="$repo_root/roles/k3s_server/tasks/join_master.yml"
for task_file in "$main_tasks" "$join_tasks"; do
for property in \
'Delegate=yes' \
'TasksMax=infinity' \
'KillMode=process' \
'LimitNOFILE=1048576' \
'LimitNPROC=infinity' \
'LimitCORE=infinity'; do
grep -Fq -- "$property" "$task_file" || {
printf '%s is missing transient K3s property %s\n' "$task_file" "$property" >&2
exit 1
}
done
done
if grep -Fq -- "node-role.kubernetes.io/master=true' -o=jsonpath" "$main_tasks"; then
printf 'control-plane registration still depends on the optional legacy master role key\n' >&2
exit 1
fi
grep -Fq -- "map('extract', hostvars, 'ansible_hostname')" "$main_tasks"
grep -Fq -- 'difference(nodes.stdout.split())' "$main_tasks"
grep -Fq -- 'crd/addons.k3s.cattle.io' "$main_tasks"
grep -Fq -- 'crd/helmcharts.helm.cattle.io' "$main_tasks"
grep -Fq -- 'crd/helmchartconfigs.helm.cattle.io' "$main_tasks"
printf 'K3s transient bootstrap regression test passed\n'