-
Notifications
You must be signed in to change notification settings - Fork 0
Delete single arch image fix #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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). | | ||
|
||
| | `--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. | | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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: | ||
|
||
| pass | ||
| logger.info(f"DELETE Success: {url}") | ||
| return True | ||
|
|
||
|
|
@@ -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 | ||
|
|
||
There was a problem hiding this comment.
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".