Skip to content

Commit fc2539a

Browse files
authored
fix(BA-970): Prevent image forget CLI from deleting registry image (#3983)
1 parent 40be4c2 commit fc2539a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/ai/backend/client/cli/image.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,14 @@ def forget(reference_or_id, arch):
7575
with Session() as session:
7676
try:
7777
image_id = get_image_id(session, reference_or_id, architecture=arch)
78-
except BackendAPIError:
79-
print_fail("Could not find image.")
78+
except BackendAPIError as e:
79+
print_fail(f"Could not find image. Error: {e}")
8080
if not arch:
8181
print_warn(
8282
"`arch` parameter not passed. If you are trying to resolve image via its canonical string you have to specify which architecture are you trying to manipulate with."
8383
)
8484
sys.exit(ExitCode.FAILURE)
8585
try:
86-
result = session.Image.untag_image_from_registry(image_id)
8786
result = session.Image.forget_image_by_id(image_id)
8887
except Exception as e:
8988
print_error(e)

src/ai/backend/client/func/image.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async def get(
6666
q = _d("""
6767
query($reference: String!, $architecture: String!) {
6868
image(reference: $reference, architecture: $architecture) {
69-
$fields"
69+
$fields
7070
}
7171
}
7272
""")

0 commit comments

Comments
 (0)