[go: nahoru, domu]

Skip to content
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

ci: cache: Filter out non-printable characters from tag #9659

Merged
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
ci: cache: Filter out non-printable characters from tag
- The tags have a trailing non-printable character, which results
in our cache tags having a trailing underscore e.g. `ghcr.io/kata-containers/cached-artefacts/agent:ce24e9835_`
For ease of use of these cached components, we should strip off the trailing underscore.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
  • Loading branch information
stevenhorsman committed May 17, 2024
commit 42fddb55303299ca0777f4738b044beda0d665cb
Original file line number Diff line number Diff line change
Expand Up @@ -1148,8 +1148,9 @@ handle_build() {
echo "Pushing ${build_target} with tags: ${tags[*]}"

for tag in "${tags[@]}"; do
# tags can only contain lowercase and uppercase letters, digits, underscores, periods, and hyphens
tag=("$(echo ${tag} | tr -c '[a-zA-Z0-9\_\.\-]' _)")
# tags can only contain lowercase and uppercase letters, digits, underscores, periods, and hyphens, so
# filter out non-printable characers and then replace invalid printable characters with underscode
tag=("$(echo ${tag} | tr -dc '[:print:]' | tr -c '[a-zA-Z0-9\_\.\-]' _)")
case ${build_target} in
kernel-nvidia-gpu)
sudo oras push \
Expand Down
Loading