Skip to content
Draft
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: 5 additions & 0 deletions .github/workflows/verify-split-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ on:
- "tests/forge-connection.sh"
- "tests/failed-command-output.sh"
- "tests/forge-release-json.sh"
- "tests/container-identity.sh"
- ".github/workflows/verify-split-files.yml"
push:
branches: [main]
Expand All @@ -59,6 +60,7 @@ on:
- "tests/forge-connection.sh"
- "tests/failed-command-output.sh"
- "tests/forge-release-json.sh"
- "tests/container-identity.sh"
- ".github/workflows/verify-split-files.yml"
workflow_dispatch:

Expand All @@ -80,6 +82,9 @@ jobs:
done < <(find $ENGINE_DIRS -name '*.func' -type f)
exit $fail

- name: Container identity regression tests
run: bash tests/container-identity.sh

- name: ISO storage regression tests
run: bash tests/vm-iso-storage.sh

Expand Down
2 changes: 1 addition & 1 deletion core/build.func
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ _CS_ENGINE_FILES=(
lib/alpine.func api/api.func
api/errorlog.func api/exitcodes.func api/sysinfo.func
api/telemetry.func
ui/build-ui.func ui/advanced.func ui/defaults.func
ui/build-ui.func ui/advanced.func ui/defaults.func ui/identity.func
ui/menu.func ui/validate.func vm/cloud-init.func vm/common.func
core/core.func core/dev-mode.func core/error_handler.func
lxc/install.func lxc/platform.func host/preflight.func
Expand Down
18 changes: 12 additions & 6 deletions pve/backend.func
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ reclaim_tty() {
# umask. Scoped to the call, so the operator's umask still governs everything
# else we write on the host.
_pct_create() {
_identity_assert_id "$1" || return 1
local prev rc
prev="$(umask)"
umask 022
Expand Down Expand Up @@ -358,6 +359,7 @@ lxc_os_support_check() {
build_container() {
# if [ "$VERBOSE" == "yes" ]; then set -x; fi

_identity_assert_id "$CT_ID" || exit 208
lxc_os_support_check

NET_STRING="-net0 name=eth0,bridge=${BRG:-vmbr0}"
Expand Down Expand Up @@ -1717,7 +1719,8 @@ PROFILE
echo -e "${BFR}${CM}${GN}Container ${CTID} removed${CL}"
echo ""
local old_ctid="$CTID"
export CTID=$(get_valid_container_id "$CTID")
CTID=$(get_valid_container_id "$CTID") || exit 109
export CTID
export VERBOSE="yes"
export var_verbose="yes"

Expand Down Expand Up @@ -1819,7 +1822,8 @@ PROFILE
local old_ctid="$CTID"
local old_ram="$RAM_SIZE"
local old_cpu="$CORE_COUNT"
export CTID=$(get_valid_container_id "$CTID")
CTID=$(get_valid_container_id "$CTID") || exit 109
export CTID
export RAM_SIZE=$((RAM_SIZE * 2))
export CORE_COUNT=$((CORE_COUNT * 2))
export var_ram="$RAM_SIZE"
Expand Down Expand Up @@ -1850,7 +1854,8 @@ PROFILE
echo ""
local old_ctid="$CTID"
local old_disk="$DISK_SIZE"
export CTID=$(get_valid_container_id "$CTID")
CTID=$(get_valid_container_id "$CTID") || exit 109
export CTID
export DISK_SIZE=$((DISK_SIZE * 2))
export var_disk="$DISK_SIZE"
export VERBOSE="yes"
Expand Down Expand Up @@ -1878,7 +1883,8 @@ PROFILE
echo -e "${BFR}${CM}${GN}Container ${CTID} removed${CL}"
echo ""
local old_ctid="$CTID"
export CTID=$(get_valid_container_id "$CTID")
CTID=$(get_valid_container_id "$CTID") || exit 109
export CTID
export DNS_RETRY_OVERRIDE="true"
export VERBOSE="yes"
export var_verbose="yes"
Expand Down Expand Up @@ -2853,7 +2859,7 @@ create_lxc_container() {
}
if qm status "$CTID" &>/dev/null || pct status "$CTID" &>/dev/null; then
msg_warn "Container/VM ID $CTID is already in use (detected late). Reassigning..."
CTID=$(get_valid_container_id "$((CTID + 1))")
CTID=$(get_valid_container_id "$((CTID + 1))") || exit 109
export CTID
msg_ok "Reassigned to container ID $CTID"
fi
Expand Down Expand Up @@ -3412,7 +3418,7 @@ create_lxc_container() {

if grep -qiE 'already exists|already in use' "$LOGFILE"; then
local old_ctid="$CTID"
CTID=$(get_valid_container_id "$((CTID + 1))")
CTID=$(get_valid_container_id "$((CTID + 1))") || exit 109
export CTID
msg_warn "Container ID $old_ctid was claimed by another process. Retrying with ID $CTID"
LOGFILE="/tmp/pct_create_${CTID}_$(date +%Y%m%d_%H%M%S)_${SESSION_ID}.log"
Expand Down
Loading
Loading