mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-08 11:27:29 +00:00
Merge pull request #9684 from stevenhorsman/add-arch-to-component-cache-tags
ci: cache: Add arch suffix to all cache tags
This commit is contained in:
commit
0b32360ab4
@ -801,7 +801,7 @@ install_ovmf_sev() {
|
|||||||
|
|
||||||
install_agent() {
|
install_agent() {
|
||||||
latest_artefact="$(git log -1 --abbrev=9 --pretty=format:"%h" ${repo_root_dir}/src/agent)"
|
latest_artefact="$(git log -1 --abbrev=9 --pretty=format:"%h" ${repo_root_dir}/src/agent)"
|
||||||
artefact_tag="$(git log -1 --abbrev=9 --pretty=format:"%h" ${repo_root_dir})"
|
artefact_tag="$(git log -1 --pretty=format:"%H" ${repo_root_dir})"
|
||||||
latest_builder_image="$(get_agent_image_name)"
|
latest_builder_image="$(get_agent_image_name)"
|
||||||
|
|
||||||
install_cached_tarball_component \
|
install_cached_tarball_component \
|
||||||
@ -1137,7 +1137,7 @@ handle_build() {
|
|||||||
|
|
||||||
echo "${ARTEFACT_REGISTRY_PASSWORD}" | sudo oras login "${ARTEFACT_REGISTRY}" -u "${ARTEFACT_REGISTRY_USERNAME}" --password-stdin
|
echo "${ARTEFACT_REGISTRY_PASSWORD}" | sudo oras login "${ARTEFACT_REGISTRY}" -u "${ARTEFACT_REGISTRY_USERNAME}" --password-stdin
|
||||||
|
|
||||||
tags=(latest-${TARGET_BRANCH}-$(uname -m))
|
tags=(latest-"${TARGET_BRANCH}")
|
||||||
if [ -n "${artefact_tag:-}" ]; then
|
if [ -n "${artefact_tag:-}" ]; then
|
||||||
tags+=("${artefact_tag}")
|
tags+=("${artefact_tag}")
|
||||||
fi
|
fi
|
||||||
@ -1148,9 +1148,11 @@ handle_build() {
|
|||||||
echo "Pushing ${build_target} with tags: ${tags[*]}"
|
echo "Pushing ${build_target} with tags: ${tags[*]}"
|
||||||
|
|
||||||
for tag in "${tags[@]}"; do
|
for tag in "${tags[@]}"; do
|
||||||
# tags can only contain lowercase and uppercase letters, digits, underscores, periods, and hyphens, so
|
# tags can only contain lowercase and uppercase letters, digits, underscores, periods, and hyphens
|
||||||
# filter out non-printable characers and then replace invalid printable characters with underscode
|
# and limited to 128 characters, so filter out non-printable characers, replace invalid printable
|
||||||
tag=("$(echo ${tag} | tr -dc '[:print:]' | tr -c '[a-zA-Z0-9\_\.\-]' _)")
|
# characters with underscode and trim down to leave enough space for the arch suffix
|
||||||
|
tag_length_limit=$(expr 128 - $(echo "-$(uname -m)" | wc -c))
|
||||||
|
tag=("$(echo ${tag} | tr -dc '[:print:]' | tr -c '[a-zA-Z0-9\_\.\-]' _ | head -c ${tag_length_limit})-$(uname -m)")
|
||||||
case ${build_target} in
|
case ${build_target} in
|
||||||
kernel-nvidia-gpu)
|
kernel-nvidia-gpu)
|
||||||
sudo oras push \
|
sudo oras push \
|
||||||
|
Loading…
Reference in New Issue
Block a user