Skip to content

Commit f36159f

Browse files
committed
Add service culling/timeout setter
1 parent 476ad96 commit f36159f

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

cli/polyaxon/_k8s/custom_resources/setter.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,26 @@ def set_termination(custom_object: Dict, termination: V1Termination) -> Dict:
1414
termination_spec["activeDeadlineSeconds"] = termination.timeout
1515
if termination.ttl:
1616
termination_spec["ttlSecondsAfterFinished"] = termination.ttl
17+
if termination.culling:
18+
culling_spec = {}
19+
if termination.culling.timeout:
20+
culling_spec["timeout"] = termination.culling.timeout
21+
termination_spec["culling"] = culling_spec
22+
if termination.probe:
23+
probe_spec = {}
24+
if termination.probe.var_exec:
25+
exec_spec = {}
26+
if termination.probe.var_exec.command:
27+
exec_spec["command"] = termination.probe.var_exec.command
28+
probe_spec["exec"] = exec_spec
29+
if termination.probe.http:
30+
http_spec = {}
31+
if termination.probe.http.path:
32+
http_spec["path"] = termination.probe.http.path
33+
if termination.probe.http.port:
34+
http_spec["port"] = termination.probe.http.port
35+
probe_spec["http"] = http_spec
36+
termination_spec["probe"] = probe_spec
1737

1838
custom_object["termination"] = termination_spec
1939
return custom_object

0 commit comments

Comments
 (0)