mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-06 12:06:49 +00:00
packaging: Track files correctly when naming builder image for agent
The necessary files for the agent builder image can be found in `tools/packaging/static-build/agent`, `ci/install_libseccomp.sh` and `tools/packaging/kata-deploy/local-build/kata-deploy-copy-libseccomp-installer.sh`. Identifying the correct files addresses the previously misreferenced path used to name the builder image. Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
This commit is contained in:
parent
f3bc6e4155
commit
2e1d770fcf
@ -181,11 +181,13 @@ install_image() {
|
||||
|
||||
local osbuilder_last_commit="$(get_last_modification "${repo_root_dir}/tools/osbuilder")"
|
||||
local guest_image_last_commit="$(get_last_modification "${repo_root_dir}/tools/packaging/guest-image")"
|
||||
local agent_last_commit="$(get_last_modification "${repo_root_dir}/src/agent")"
|
||||
local libs_last_commit="$(get_last_modification "${repo_root_dir}/src/libs")"
|
||||
local gperf_version="$(get_from_kata_deps "externals.gperf.version")"
|
||||
local libseccomp_version="$(get_from_kata_deps "externals.libseccomp.version")"
|
||||
local rust_version="$(get_from_kata_deps "languages.rust.meta.newest-version")"
|
||||
local agent_last_commit=$(merge_two_hashes \
|
||||
"$(get_last_modification "${repo_root_dir}/src/agent")" \
|
||||
"$(get_last_modification "${repo_root_dir}/tools/packaging/static-build/agent")")
|
||||
|
||||
latest_artefact="${osbuilder_last_commit}-${guest_image_last_commit}-${agent_last_commit}-${libs_last_commit}-${gperf_version}-${libseccomp_version}-${rust_version}-${image_type}"
|
||||
latest_builder_image=""
|
||||
@ -231,11 +233,13 @@ install_initrd() {
|
||||
|
||||
local osbuilder_last_commit="$(get_last_modification "${repo_root_dir}/tools/osbuilder")"
|
||||
local guest_image_last_commit="$(get_last_modification "${repo_root_dir}/tools/packaging/guest-image")"
|
||||
local agent_last_commit="$(get_last_modification "${repo_root_dir}/src/agent")"
|
||||
local libs_last_commit="$(get_last_modification "${repo_root_dir}/src/libs")"
|
||||
local gperf_version="$(get_from_kata_deps "externals.gperf.version")"
|
||||
local libseccomp_version="$(get_from_kata_deps "externals.libseccomp.version")"
|
||||
local rust_version="$(get_from_kata_deps "languages.rust.meta.newest-version")"
|
||||
local agent_last_commit=$(merge_two_hashes \
|
||||
"$(get_last_modification "${repo_root_dir}/src/agent")" \
|
||||
"$(get_last_modification "${repo_root_dir}/tools/packaging/static-build/agent")")
|
||||
|
||||
latest_artefact="${osbuilder_last_commit}-${guest_image_last_commit}-${agent_last_commit}-${libs_last_commit}-${gperf_version}-${libseccomp_version}-${rust_version}-${initrd_type}"
|
||||
latest_builder_image=""
|
||||
|
@ -95,6 +95,13 @@ get_kata_hash() {
|
||||
git ls-remote --heads --tags "https://github.com/${project}/${repo}.git" | grep "${ref}" | awk '{print $1}'
|
||||
}
|
||||
|
||||
merge_two_hashes() {
|
||||
local hash1="${1}"
|
||||
local hash2="${2}"
|
||||
|
||||
echo "${hash1}${hash2}" | sha256sum | cut -c1-9
|
||||
}
|
||||
|
||||
# $1 - The file we're looking for the last modification
|
||||
get_last_modification() {
|
||||
local file="${1}"
|
||||
@ -211,10 +218,12 @@ get_tools_image_name() {
|
||||
}
|
||||
|
||||
get_agent_image_name() {
|
||||
libs_dir="${repo_root_dir}/src/libs"
|
||||
agent_dir="${repo_root_dir}/src/agent"
|
||||
libseccomp_hash=$(merge_two_hashes \
|
||||
"$(get_last_modification "${repo_root_dir}/ci/install_libseccomp.sh")" \
|
||||
"$(get_last_modification "${repo_root_dir}/tools/packaging/kata-deploy/local-build/kata-deploy-copy-libseccomp-installer.sh")")
|
||||
agent_dir="${repo_root_dir}/tools/packaging/static-build/agent"
|
||||
|
||||
echo "${BUILDER_REGISTRY}:agent-$(get_last_modification ${libs_dir})-$(get_last_modification ${agent_dir})-$(uname -m)"
|
||||
echo "${BUILDER_REGISTRY}:agent-${libseccomp_hash}-$(get_last_modification ${agent_dir})-$(uname -m)"
|
||||
}
|
||||
|
||||
get_coco_guest_components_image_name() {
|
||||
|
Loading…
Reference in New Issue
Block a user