Skip to content

Commit 81a5c37

Browse files
author
smothiki
committed
feat(healthcheck): remove default healthcheck for apps
1 parent 600f888 commit 81a5c37

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

rootfs/api/models/config.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ def __str__(self):
2828

2929
def healthcheck(self):
3030
# Update healthcheck - Scheduler determines the app type
31+
if 'HEALTHCHECK_URL' not in self.values.keys():
32+
return {}
3133
path = self.values.get('HEALTHCHECK_URL', '/')
32-
timeout = int(self.values.get('HEALTHCHECK_TIMEOUT', 1))
33-
delay = int(self.values.get('HEALTHCHECK_INITIAL_DELAY', 10))
34+
timeout = int(self.values.get('HEALTHCHECK_TIMEOUT', 50))
35+
delay = int(self.values.get('HEALTHCHECK_INITIAL_DELAY', 50))
3436
port = int(self.values.get('HEALTHCHECK_PORT', 8080))
3537

3638
return {'path': path, 'timeout': timeout, 'delay': delay, 'port': port}

rootfs/scheduler/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,8 @@ def _create_rc(self, name, image, command, **kwargs): # noqa
652652
containers[0]["resources"]["limits"]["cpu"] = cpu
653653

654654
# add in healtchecks
655-
js_template = self._healthcheck(js_template, **kwargs['healthcheck'])
655+
if kwargs.get('healthcheck'):
656+
js_template = self._healthcheck(js_template, **kwargs['healthcheck'])
656657

657658
url = self._api("/namespaces/{}/replicationcontrollers", app_name)
658659
resp = self.session.post(url, json=js_template)

0 commit comments

Comments
 (0)