fix: enforce LXC bootstrap locks (#1098)
cascading-pr from https://code.forgejo.org/forgejo/lxc-helpers/pulls/51 <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - bug fixes - [PR](https://code.forgejo.org/forgejo/runner/pulls/1098): <!--number 1098 --><!--line 0 --><!--description Zml4OiBlbmZvcmNlIExYQyBib290c3RyYXAgbG9ja3M=-->fix: enforce LXC bootstrap locks<!--description--> <!--end release-notes-assistant--> Co-authored-by: cascading-pr <cascading-pr@example.com> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1098 Co-authored-by: cascading-pr <cascading-pr@noreply.code.forgejo.org> Co-committed-by: cascading-pr <cascading-pr@noreply.code.forgejo.org>
This commit is contained in:
parent
a7487dadd7
commit
d92a892ece
1 changed files with 4 additions and 4 deletions
|
|
@ -74,8 +74,6 @@ function lxc_transaction_begin() {
|
|||
|
||||
lxc_transaction_lock
|
||||
lxc_container_destroy $draft
|
||||
|
||||
echo $draft
|
||||
}
|
||||
|
||||
function lxc_transaction_commit() {
|
||||
|
|
@ -391,7 +389,8 @@ function lxc_build_template_release() {
|
|||
return
|
||||
fi
|
||||
|
||||
local draft=$(lxc_transaction_begin $name)
|
||||
lxc_transaction_begin $name
|
||||
local draft=$(lxc_transaction_draft_name)
|
||||
$LXC_SUDO lxc-create --name $draft --template debian -- --release=$LXC_CONTAINER_RELEASE
|
||||
echo 'lxc.apparmor.profile = unconfined' | $LXC_SUDO tee -a $(lxc_config $draft)
|
||||
lxc_container_install_lxc_helpers $draft
|
||||
|
|
@ -414,7 +413,8 @@ function lxc_build_template() {
|
|||
lxc_build_template_release
|
||||
fi
|
||||
|
||||
local draft=$(lxc_transaction_begin $newname)
|
||||
lxc_transaction_begin $name
|
||||
local draft=$(lxc_transaction_draft_name)
|
||||
if ! $LXC_SUDO lxc-copy --name=$name --newname=$draft; then
|
||||
echo lxc-copy --name=$name --newname=$draft failed
|
||||
return 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue