Skip to content

Commit c6686e9

Browse files
committed
fix(scheduler): cast ports to int before passing them on to k8s
when doing config:set PORT=80 then k8s complains that 80 is not a valid port / name
1 parent d2fa2c2 commit c6686e9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

rootfs/scheduler/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ def _update_application_service(self, namespace, name, app_type, port, routable=
464464
for pos, item in enumerate(service['spec']['ports']):
465465
if item['port'] == 80 and port != item['targetPort']:
466466
# port 80 is the only one we care about right now
467-
service['spec']['ports'][pos]['targetPort'] = port
467+
service['spec']['ports'][pos]['targetPort'] = int(port)
468468

469469
self._update_service(namespace, namespace, data=service)
470470
except Exception as e:
@@ -1181,7 +1181,7 @@ def _healthcheck(self, namespace, container, routable=False, path='/', port=5000
11811181
# an http probe
11821182
'httpGet': {
11831183
'path': path,
1184-
'port': port
1184+
'port': int(port)
11851185
},
11861186
# length of time to wait for a pod to initialize
11871187
# after pod startup, before applying health checking
@@ -1195,7 +1195,7 @@ def _healthcheck(self, namespace, container, routable=False, path='/', port=5000
11951195
# an http probe
11961196
'httpGet': {
11971197
'path': path,
1198-
'port': port
1198+
'port': int(port)
11991199
},
12001200
# length of time to wait for a pod to initialize
12011201
# after pod startup, before applying health checking
@@ -1264,7 +1264,7 @@ def _default_dockerapp_readiness_probe(self, port, delay=5, timeout=5, period_se
12641264
'readinessProbe': {
12651265
# an exec probe
12661266
'tcpSocket': {
1267-
"port": port
1267+
"port": int(port)
12681268
},
12691269
# length of time to wait for a pod to initialize
12701270
# after pod startup, before applying health checking

0 commit comments

Comments
 (0)