Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit d12f175

Browse files
committed
Fixing python function listening only to root address, while other runtimes use wildcard
1 parent 7e7075a commit d12f175

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

docker/runtime/python/kubeless.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,17 @@ def funcWrap(q, event, c):
4040
except Exception as inst:
4141
q.put(inst)
4242

43-
@app.route('/', method=['GET', 'POST', 'PATCH', 'DELETE'])
43+
@app.get('/healthz')
44+
def healthz():
45+
return 'OK'
46+
47+
@app.get('/metrics')
48+
def metrics():
49+
bottle.response.content_type = prom.CONTENT_TYPE_LATEST
50+
return prom.generate_latest(prom.REGISTRY)
51+
52+
53+
@app.route('/<:re:.*>', method=['GET', 'POST', 'PATCH', 'DELETE'])
4454
def handler():
4555
req = bottle.request
4656
content_type = req.get_header('content-type')
@@ -76,14 +86,6 @@ def handler():
7686
raise res
7787
return res
7888

79-
@app.get('/healthz')
80-
def healthz():
81-
return 'OK'
82-
83-
@app.get('/metrics')
84-
def metrics():
85-
bottle.response.content_type = prom.CONTENT_TYPE_LATEST
86-
return prom.generate_latest(prom.REGISTRY)
8789

8890
if __name__ == '__main__':
8991
import logging

0 commit comments

Comments
 (0)