Skip to content

Commit 48dbade

Browse files
committed
fix(rootfs/api): convert type.
termination grace period type conversion
1 parent 63c3f60 commit 48dbade

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

rootfs/api/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def validate_termination_grace_period(self, data):
309309
if not re.match(PROCTYPE_MATCH, key):
310310
raise serializers.ValidationError(PROCTYPE_MISMATCH_MSG)
311311

312-
timeout = re.match(TERMINATION_GRACE_PERIOD_MATCH, value)
312+
timeout = re.match(TERMINATION_GRACE_PERIOD_MATCH, str(value))
313313
if not timeout:
314314
raise serializers.ValidationError(
315315
"Termination Grace Period format: <value>, where value must be a numeric")

rootfs/scheduler/resources/pod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def _get_termination_grace_period(self, kwargs):
261261
timeout_global = kwargs.get('pod_termination_grace_period_seconds', 30)
262262
timeout_local = kwargs.get("pod_termination_grace_period_each", {}).get(app_type)
263263

264-
return timeout_global if timeout_local is None else timeout_local
264+
return timeout_global if timeout_local is None else int(timeout_local)
265265

266266
def _format_memory(self, mem):
267267
""" Format memory limit value """

0 commit comments

Comments
 (0)