Bug #38072
openAs a user, I can see an overview of container images used with image-mode systems via API & hammer
Description
As a user, I can see an overview of container images used with image-mode systems via API & hammer
Cloned from 16206736
Create a new API endpoint that shows the container images used by booted bootc hosts.
Show a list of image paths and the digests within along with the number of hosts that are using each digest.
If the digest shown isn't the most up-to-date digest for the givent image, then the user will know that the host is out of date.
Updated by Ian Ballou 11 days ago ยท Edited
Example code to generate the hash that the API could return:
results = ::Katello::Host::ContentFacet.select(:bootc_booted_image, :bootc_booted_digest, 'COUNT(hosts.id) as host_count').joins(:host).group(:bootc_booted_image, :bootc_booted_digest)
image_mode_map = Hash.new { |h,k| h[k] = [] }
results.each do |host_image|
image_mode_map[host_image.bootc_booted_image] << { bootc_booted_digest: host_image.bootc_booted_digest, host_count: host_image.host_count.to_i }
end
The hash looks like:
{"quay.io/centos-bootc/centos-bootc:stream10"=>[{:bootc_booted_digest=>"sha256:3131aff321a3f34abd4ec7b242d80a75de7fbee32693fe4156d6866fdde0e4cd", :host_count=>1}],...}
This json could power a page that lists each image with the varying hashes inside and a host count for each hash inside the image.
Updated by Ian Ballou 11 days ago
For hammer, I'm thinking users could use a new `hammer host bootc-images` command. It would be a bit similar to the `hammer host facts` paradigm in that it lists aggregate information about all hosts.
Updated by Ian Ballou 7 days ago
- Category set to Hosts
- Assignee set to Ian Ballou
- Triaged changed from No to Yes
Updated by The Foreman Bot 6 days ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/11257 added