Skip to content

Comments

KONFLUX-12163 : Add function to return first architecture of a container image#710

Open
ashwgit wants to merge 2 commits intokonflux-ci:mainfrom
ashwgit:func-fetch-first-arch
Open

KONFLUX-12163 : Add function to return first architecture of a container image#710
ashwgit wants to merge 2 commits intokonflux-ci:mainfrom
ashwgit:func-fetch-first-arch

Conversation

@ashwgit
Copy link
Contributor

@ashwgit ashwgit commented Feb 10, 2026

@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.

@snyk-io
Copy link

snyk-io bot commented Feb 10, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@5f33b66). Learn more about missing BASE report.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ashwgit ashwgit force-pushed the func-fetch-first-arch branch 4 times, most recently from 9df1d97 to 552cf5e Compare February 11, 2026 11:42
@yashvardhannanavati
Copy link
Contributor

@ashwgit could you rebase on main please

@ashwgit ashwgit force-pushed the func-fetch-first-arch branch from 552cf5e to bd72f6d Compare February 17, 2026 09:51
@ashwgit
Copy link
Contributor Author

ashwgit commented Feb 17, 2026

/retest

3 similar comments
@ashwgit
Copy link
Contributor Author

ashwgit commented Feb 18, 2026

/retest

@ashwgit
Copy link
Contributor Author

ashwgit commented Feb 18, 2026

/retest

@ashwgit
Copy link
Contributor Author

ashwgit commented Feb 18, 2026

/retest

Ashwini Kumar added 2 commits February 23, 2026 13:35
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
@ashwgit ashwgit force-pushed the func-fetch-first-arch branch from bd72f6d to 51e3a42 Compare February 23, 2026 08:06
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants