Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
fix(scheduler): cast ports to int before passing them on to k8s
Browse files Browse the repository at this point in the history
when doing config:set PORT=80 then k8s complains that 80 is not a valid port / name
  • Loading branch information
helgi authored and mboersma committed Jun 7, 2016
1 parent 816a36b commit 5910902
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rootfs/scheduler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ def _update_application_service(self, namespace, name, app_type, port, routable=
for pos, item in enumerate(service['spec']['ports']):
if item['port'] == 80 and port != item['targetPort']:
# port 80 is the only one we care about right now
service['spec']['ports'][pos]['targetPort'] = port
service['spec']['ports'][pos]['targetPort'] = int(port)

self._update_service(namespace, namespace, data=service)
except Exception as e:
Expand Down Expand Up @@ -1181,7 +1181,7 @@ def _healthcheck(self, namespace, container, routable=False, path='/', port=5000
# an http probe
'httpGet': {
'path': path,
'port': port
'port': int(port)
},
# length of time to wait for a pod to initialize
# after pod startup, before applying health checking
Expand All @@ -1195,7 +1195,7 @@ def _healthcheck(self, namespace, container, routable=False, path='/', port=5000
# an http probe
'httpGet': {
'path': path,
'port': port
'port': int(port)
},
# length of time to wait for a pod to initialize
# after pod startup, before applying health checking
Expand Down Expand Up @@ -1264,7 +1264,7 @@ def _default_dockerapp_readiness_probe(self, port, delay=5, timeout=5, period_se
'readinessProbe': {
# an exec probe
'tcpSocket': {
"port": port
"port": int(port)
},
# length of time to wait for a pod to initialize
# after pod startup, before applying health checking
Expand Down

0 comments on commit 5910902

Please sign in to comment.