Skip to content
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
5 changes: 5 additions & 0 deletions lib/kitchen/docker/helpers/image_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ def parse_image_id(output)
img_id = line.split(/\s+/).last
return img_id
end
# Docker ~v4.31 support
if line =~ /naming to moby-dangling@(sha256:[[:xdigit:]]{64})(?: \d*\.\ds)? done/i
img_id = line[/naming to moby-dangling@(sha256:[[:xdigit:]]{64})(?: \d*\.\ds)? done/i, 1]
Comment on lines +39 to +40
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

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

The regex pattern /naming to moby-dangling@(sha256:[[:xdigit:]]{64})(?: \d*\.\ds)? done/i is duplicated on consecutive lines. Consider extracting it to a variable to improve maintainability and performance. For example: pattern = /naming to moby-dangling@(sha256:[[:xdigit:]]{64})(?: \d*\.\ds)? done/i then use if line =~ pattern and img_id = line[pattern, 1].

Copilot uses AI. Check for mistakes.
return img_id
end
end
raise ActionFailed, "Could not parse Docker build output for image ID"
end
Expand Down
Loading