Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit c374321

Browse files
author
Łukasz Piątkowski
committed
fix: KeyError when labels are missing
1 parent 2df025c commit c374321

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docker_enforcer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def make_container_periodic_check_compatible(cont_json, url, owner):
251251
url_params = parse.parse_qs(url.query)
252252
cont_json["Name"] = "<unnamed_container>" if "name" not in url_params else url_params["name"][0]
253253
cont_json["Config"] = {}
254-
cont_json["Config"]["Labels"] = cont_json["Labels"]
254+
cont_json["Config"]["Labels"] = cont_json.get("Labels", [])
255255
return Container(cont_json["Name"], params=cont_json, metrics={}, position=0,
256256
check_source=CheckSource.AuthzPlugin, owner=owner)
257257

0 commit comments

Comments
 (0)