Skip to content

Commit b29e110

Browse files
committed
chore: always fallback on linux/amd64, regardless of platform
1 parent d969b92 commit b29e110

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

ggshield/verticals/secret/docker.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import json
4-
import platform
54
import re
65
import subprocess
76
import tarfile
@@ -297,11 +296,10 @@ def docker_pull_image(image_name: str, timeout: int) -> None:
297296
if _run_docker_command(base_command, timeout):
298297
return
299298

300-
# Apple Silicon: fall back to linux/amd64 if no success
301-
if platform.system() == "Darwin" and platform.machine() == "arm64":
302-
amd64_command = base_command + ["--platform=linux/amd64"]
303-
if _run_docker_command(amd64_command, timeout):
304-
return
299+
# Fall back to linux/amd64 if no success
300+
amd64_command = base_command + ["--platform=linux/amd64"]
301+
if _run_docker_command(amd64_command, timeout):
302+
return
305303

306304
# Raise error if no success
307305
raise UsageError(f'Image "{image_name}" not found')
@@ -357,7 +355,7 @@ def docker_save_to_tmp(image_name: str, destination_path: Path, timeout: int) ->
357355
except subprocess.CalledProcessError as exc:
358356
err_string = str(exc.stderr)
359357
if "No such image" in err_string or "reference does not exist" in err_string:
360-
ui.display_info("need to download image first") # ici
358+
ui.display_info("need to download image first")
361359
docker_pull_image(image_name, timeout)
362360

363361
docker_save_to_tmp(image_name, destination_path, timeout)

0 commit comments

Comments
 (0)