Skip to content

Commit

Permalink
[docker,podman] Collect container image layers
Browse files Browse the repository at this point in the history
Adds collection of container image layers for the docker and podman
plugins via the `history` and `tree` subcommands repsectively.

Related: #3796

Signed-off-by: Jake Hunsaker <[email protected]>
  • Loading branch information
TurboTurtle committed Oct 16, 2024
1 parent a642018 commit 58d7824
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sos/report/plugins/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ def setup(self):
insp = name if 'none' not in name else img_id
self.add_cmd_output(f"docker inspect {insp}", subdir='images',
tags="docker_image_inspect")
self.add_cmd_output(
f"docker image history {insp}",
subdir='images/history',
tags='docker_image_tree'
)

for vol in volumes:
self.add_cmd_output(f"docker volume inspect {vol}",
Expand Down
6 changes: 6 additions & 0 deletions sos/report/plugins/podman.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def setup(self):

subcmds = [
'info',
'image trust show',
'images',
'images --digests',
'pod ps',
Expand Down Expand Up @@ -109,6 +110,11 @@ def setup(self):
insp = name if 'none' not in name else img_id
self.add_cmd_output(f"podman inspect {insp}", subdir='images',
tags='podman_image_inspect')
self.add_cmd_output(
f"podman image tree {insp}",
subdir='images/tree',
tags='podman_image_tree'
)

for vol in volumes:
self.add_cmd_output(f"podman volume inspect {vol}",
Expand Down

0 comments on commit 58d7824

Please sign in to comment.