Skip to content

Commit 1b55de3

Browse files
krisnovamboersma
authored andcommitted
fiix(ingress): Fix HTTP exception arguments
Instead of raising HTTP exception, lets raise ServiceUnavailable Non breaking change
1 parent 726a587 commit 1b55de3

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

rootfs/api/models/app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ def create(self, *args, **kwargs): # noqa
227227
try:
228228
# In order to create an ingress, we must first have a namespace.
229229
if settings.EXPERIMENTAL_NATIVE_INGRESS:
230+
if ingress == "":
231+
raise ServiceUnavailable('Empty hostname')
230232
try:
231233
self._scheduler.ingress.get(ingress)
232234
except KubeException:

rootfs/scheduler/resources/ingress.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ def get(self, name=None, **kwargs):
2525
def create(self, ingress, namespace, hostname):
2626
url = "/apis/extensions/v1beta1/namespaces/%s/ingresses" % namespace
2727

28-
if hostname == "":
29-
raise KubeHTTPException("empty hostname value")
30-
3128
data = {
3229
"kind": "Ingress",
3330
"apiVersion": "extensions/v1beta1",

0 commit comments

Comments
 (0)