Add daemon-selected container monitor delegation
This commit is contained in:
@@ -117,6 +117,22 @@ def format_monitor_result(result):
|
||||
if not isinstance(result, dict):
|
||||
raise ProtocolFailure
|
||||
|
||||
if result.get("delegated") is True:
|
||||
backend = result.get("backend")
|
||||
runtime = result.get("container_runtime")
|
||||
|
||||
if backend != "container":
|
||||
raise ProtocolFailure
|
||||
|
||||
if runtime not in ("podman", "docker"):
|
||||
raise ProtocolFailure
|
||||
|
||||
return "|".join([
|
||||
"delegate",
|
||||
backend,
|
||||
runtime,
|
||||
])
|
||||
|
||||
ha = result.get("ha")
|
||||
|
||||
if not isinstance(ha, dict):
|
||||
|
||||
Reference in New Issue
Block a user