Filter only spoc apps in all app status
This commit is contained in:
parent
4420d64c45
commit
c3a73f2b28
@ -35,10 +35,10 @@ def stop_pod(app_name):
|
|||||||
run(['podman', 'pod', 'stop', '--ignore', app_name])
|
run(['podman', 'pod', 'stop', '--ignore', app_name])
|
||||||
|
|
||||||
def get_pod_status(app_name=None):
|
def get_pod_status(app_name=None):
|
||||||
cmd = ['podman', 'pod', 'ps']
|
app_filter = 'label=spoc.app'
|
||||||
if app_name:
|
if app_name:
|
||||||
cmd.extend(['--filter', f'label=spoc.app={app_name}'])
|
app_filter = f'{app_filter}={app_name}'
|
||||||
return out(cmd)
|
return out(['podman', 'pod', 'ps', '--filter', app_filter])
|
||||||
|
|
||||||
def create_volume(app_name, vol_name):
|
def create_volume(app_name, vol_name):
|
||||||
run(['podman', 'volume', 'create', '--label', f'spoc.app={app_name}', vol_name])
|
run(['podman', 'volume', 'create', '--label', f'spoc.app={app_name}', vol_name])
|
||||||
|
@ -73,7 +73,7 @@ def test_get_pod_status_all(out):
|
|||||||
out.return_value = 'RESULT'
|
out.return_value = 'RESULT'
|
||||||
status = podman.get_pod_status()
|
status = podman.get_pod_status()
|
||||||
|
|
||||||
expected_cmd = ['podman', 'pod', 'ps']
|
expected_cmd = ['podman', 'pod', 'ps', '--filter', 'label=spoc.app']
|
||||||
out.assert_called_once_with(expected_cmd)
|
out.assert_called_once_with(expected_cmd)
|
||||||
assert status == 'RESULT'
|
assert status == 'RESULT'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user