KONFLUX-12163 : Add function to return first architecture of a container image#710
KONFLUX-12163 : Add function to return first architecture of a container image#710ashwgit wants to merge 2 commits intokonflux-ci:mainfrom
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #710 +/- ##
========================================
Coverage ? 100.00%
========================================
Files ? 20
Lines ? 641
Branches ? 0
========================================
Hits ? 641
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9df1d97 to
552cf5e
Compare
|
@ashwgit could you rebase on main please |
552cf5e to
bd72f6d
Compare
|
/retest |
3 similar comments
|
/retest |
|
/retest |
|
/retest |
This function uses skopeo inspect --raw to identify the first available architecture in a manifest list. Signed-off-by: Ashwini Kumar
- Update get_image_labels to use get_first_arch. - Add test for updated get_image_labels. Signed-off-by: Ashwini Kumar
bd72f6d to
51e3a42
Compare
| if ! raw_output=$(retry skopeo inspect --raw "docker://${image}"); then | ||
| echo "get_image_labels: raw inspect failed after retries" >&2 | ||
| first_arch=$(get_first_arch "${image}") | ||
| if [ -z "${first_arch}" ] || [ "${first_arch}" == "null" ]; then |
There was a problem hiding this comment.
I am just curios. about these lines.
Am I right when I think that these same lines are inside the get_first_arch function and they end with exit 1. Which means the script will be terminated and nothing returned. Meaning if that fails inside get_first_arch function, it will never reach this part of code?
There was a problem hiding this comment.
Agree, so either we can remove these lines or modify the get_first_arch to return empty string if no arch is found. What do you suggest ?
There was a problem hiding this comment.
From what I see these kind of tests and error failing is done directly in the functions. Lets keep those lines in get_first_arch so you do not have to test it everywhere.
@lipoja @yashvardhannanavati PTAL, this one adds a function which can be used to fetch the first available arch of the container. Once deployed I will change the skopeo calls accordingly.