Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

### Sonar
- Added `--filter` flag which accepts the (Package Search Syntax)[https://docs.cloudsmith.com/artifact-management/search-filter-sort-packages] string. e.g. `--filter "downloads:>0"`.
- Deletion now correctly works against non multi-arch images. Previously they where ignored and only multi-arch images were being deleted. Additionally improved log output for deletions.
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

Spelling error: "where" should be "were" in the phrase "Previously they where ignored".

Suggested change
- Deletion now correctly works against non multi-arch images. Previously they where ignored and only multi-arch images were being deleted. Additionally improved log output for deletions.
- Deletion now correctly works against non multi-arch images. Previously they were ignored and only multi-arch images were being deleted. Additionally improved log output for deletions.

Copilot uses AI. Check for mistakes.


## [Sonar] [v1.1] [2026-01-07]

Expand Down
12 changes: 6 additions & 6 deletions Docker/Sonar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ Here is a summary of its capabilities:
2. **Advanced Flags**
| Flag | Description |
|-----------------------|--------------------------------------------------------------|
| `--detailed` | Shows every child digest (arch/os) and individual download counts. |
| `--untagged` | Finds manifest lists that have no tags (orphaned). |
| `--untagged-delete` | Deletes any untagged manifest lists found. |
| `--delete-tag` | Deletes a specific tag from the repository. |
| `--delete-all` | Wipes all images and manifest lists detected by the scan. |
| `--force` | Force deletion without interactive prompt. |
| `--detailed` | Shows child digests for multi-arch images. |
| `--untagged` | Show untagged images with no manifest/list (orphaned). |
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The description for the --untagged flag is unclear. The phrase "Show untagged images with no manifest/list (orphaned)" is ambiguous. Based on the code, this flag shows both untagged manifest lists AND orphaned single images (images with no tags and not referenced by any manifest list). Consider rephrasing to something clearer like "Show untagged manifest lists and orphaned images."

Copilot uses AI. Check for mistakes.
| `--untagged-delete` | Deletes any untagged images found. |
| `--delete-tag` | Deletes an image via tag. |
| `--delete-all` | Wipes all images and manifest lists detected. |
| `--force` | Force deletion without interactive prompt. Helpful for programmatic workflows. |
| `--output` | Use `json` value to output results to JSON format. |
| `--filter` | Query using Package Syntax Filtering. |

Expand Down
10 changes: 8 additions & 2 deletions Docker/Sonar/sonar.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ def make_request(url, headers=None, method='GET', data=None, return_headers=Fals
time.sleep(wait + 0.5)

if method == 'DELETE':
# Fix: Consume content to prevent IncompleteRead errors even if 0 bytes expected
try:
_ = response.read()
except Exception:
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Copilot uses AI. Check for mistakes.
pass
logger.info(f"DELETE Success: {url}")
return True

Expand Down Expand Up @@ -772,8 +777,9 @@ def get_image_analysis(workspace, repo, img_name, delete_all=False, delete_tag=N
for group in groups:
if not group: continue
parent = group[0]
# Only delete manifest lists
if parent.get('type') == 'manifest/list':

# Modified to allow deletion of both manifest lists AND single images
if parent.get('type') in ['manifest/list', 'image']:
should_delete = False
if delete_all:
should_delete = True
Expand Down
Loading