Skip to content

Commit ca138b7

Browse files
committed
Show container command for inactive quadlets
1 parent ae1be47 commit ca138b7

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/app.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,10 @@ class Application extends React.Component {
554554
}
555555
};
556556

557+
if (quadlet.exec) {
558+
container.Config.Cmd = quadlet.exec;
559+
}
560+
557561
const found_pod = podNameServiceMap[quadlet.pod];
558562
if (found_pod) {
559563
container.Pod = found_pod;

src/detect-quadlets.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515

1616
import json
1717
import os
18+
import shlex
1819
import sys
1920
from collections import defaultdict
2021
from pathlib import Path
21-
from typing import DefaultDict, Dict, Optional
22+
from typing import DefaultDict, Dict, List, Optional, Union
2223

2324

2425
def get_name(service_name: str, name: Optional[str]) -> str:
@@ -29,7 +30,7 @@ def get_name(service_name: str, name: Optional[str]) -> str:
2930

3031

3132
def main(generator_dir: Path) -> None:
32-
containers: DefaultDict[str, Dict[str, Optional[str]]] = defaultdict(dict)
33+
containers: DefaultDict[str, Dict[str, Union[Optional[str], List[str]]]] = defaultdict(dict)
3334
pods: DefaultDict[str, Dict[str, Optional[str]]] = defaultdict(dict)
3435

3536
try:
@@ -63,7 +64,7 @@ def main(generator_dir: Path) -> None:
6364
name = value
6465
continue
6566
elif key == "Exec":
66-
cmd = value
67+
cmd = shlex.split(value)
6768
continue
6869
elif key == "Image":
6970
image = value

test/check-application

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3410,6 +3410,9 @@ Yaml={name}.yaml
34103410
# Can stop/start/restart a container
34113411
self.performContainerAction("quak", "Stop", system=system)
34123412
b.wait(lambda: self.getContainerAttr("quak", "State", "", system=system) == "Exited")
3413+
# Shows Command when exited
3414+
b.wait_in_text(f"tr[data-row-id='{'0' if system else 'user'}-quak.service'] small:last-child",
3415+
"sleep infinity")
34133416
self.performContainerAction("quak", "Start", system=system)
34143417
b.wait(lambda: self.getContainerAttr("quak", "State", "", system=system) == "Running")
34153418
containerId = self.execute("podman inspect --format '{{.Id}}' quak", system=system).strip()

0 commit comments

Comments
 (0)