-
Notifications
You must be signed in to change notification settings - Fork 1k
Take architecture from source config while copying #18102
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,6 +131,11 @@ test_container_copy_start() { | |
| lxc copy c1 c2 | ||
| [ "$(lxc list -f csv -c s c2)" = "STOPPED" ] | ||
|
|
||
| sub_test "Copied container inherits the source architecture" | ||
| source_arch="$(lxc query /1.0/instances/c1 | jq --raw-output '.architecture')" | ||
| target_arch="$(lxc query /1.0/instances/c2 | jq --raw-output '.architecture')" | ||
| [ "${source_arch}" = "${target_arch}" ] | ||
|
Comment on lines
+134
to
+137
|
||
|
|
||
| lxc delete -f c2 | ||
|
|
||
| echo "==> Check that a container can be copied and started with the same command" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The jq extraction uses
--raw-outputon.architecture, which will yield the literal string "null" if the field is missing; comparing two "null" strings would incorrectly pass. Consider usingjq -er '.architecture'(and/or explicitly asserting it is non-empty) and declaresource_arch/target_archaslocalto match the rest of the function’s scoping style.