FIX(app): handle shell operators properly
- Wrap command in sh -c for shell operators - Fix &&, ||, | execution in host namespace
This commit is contained in:
@@ -16,5 +16,5 @@ commonLabels:
|
|||||||
# 이미지 태그 설정 (ArgoCD Image Updater가 자동으로 업데이트)
|
# 이미지 태그 설정 (ArgoCD Image Updater가 자동으로 업데이트)
|
||||||
images:
|
images:
|
||||||
- name: gitea0213.kro.kr/bluemayne/mas
|
- name: gitea0213.kro.kr/bluemayne/mas
|
||||||
newTag: main-sha-38cbbafe9d0d9d215c126396bafecf2c27bed6a7
|
newTag: main-sha-a03903666a368706b8bbebe96f334b09aaa9f7c4
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ def execute_host(command: str, timeout: int = 30, use_sudo: bool = False) -> str
|
|||||||
# -u: UTS namespace (hostname)
|
# -u: UTS namespace (hostname)
|
||||||
# -n: network namespace
|
# -n: network namespace
|
||||||
# -i: IPC namespace
|
# -i: IPC namespace
|
||||||
nsenter_command = f"nsenter -t 1 -m -u -n -i -- {command}"
|
# Wrap command in sh -c to properly handle shell operators (&&, ||, |, etc.)
|
||||||
|
nsenter_command = f"nsenter -t 1 -m -u -n -i -- sh -c {subprocess.list2cmdline([command])}"
|
||||||
|
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
nsenter_command,
|
nsenter_command,
|
||||||
|
|||||||
Reference in New Issue
Block a user