Skip to content

Commit 6c9a8c9

Browse files
authored
Fix mii wdt filterpy (#2379)
* set default listening port if the model does not set it, otherwise istio generated nap wil l have no default and failed validation * set ssl port also
1 parent 70f3ba1 commit 6c9a8c9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

operator/src/main/resources/scripts/model_wdt_mii_filter.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,11 @@ def customizeServerIstioNetworkAccessPoint(server, listen_address):
385385
if istio_readiness_port is None:
386386
return
387387
admin_server_port = server['ListenPort']
388+
# Set the default if it is not provided to avoid nap default to 0 which fails validation.
389+
390+
if admin_server_port is None:
391+
admin_server_port = 7001
392+
388393
# readiness probe
389394
_writeIstioNAP(name='http-probe', server=server, listen_address=listen_address,
390395
listen_port=istio_readiness_port, protocol='http', http_enabled="true")
@@ -413,9 +418,12 @@ def customizeServerIstioNetworkAccessPoint(server, listen_address):
413418
model = env.getModel()
414419
if ssl is not None and 'Enabled' in ssl and ssl['Enabled'] == 'true':
415420
ssl_listen_port = ssl['ListenPort']
421+
if ssl_listen_port is None:
422+
ssl_listen_port = "7002"
416423
elif ssl is None and isSecureModeEnabledForDomain(model['topology']):
417424
ssl_listen_port = "7002"
418425

426+
419427
if ssl_listen_port is not None:
420428
_writeIstioNAP(name='https-secure', server=server, listen_address=listen_address,
421429
listen_port=ssl_listen_port, protocol='https', http_enabled="true")
@@ -445,6 +453,9 @@ def customizeManagedIstioNetworkAccessPoint(template, listen_address):
445453
if istio_readiness_port is None:
446454
return
447455
listen_port = template['ListenPort']
456+
# Set the default if it is not provided to avoid nap default to 0 which fails validation.
457+
if listen_port is None:
458+
listen_port = 7001
448459
# readiness probe
449460
_writeIstioNAP(name='http-probe', server=template, listen_address=listen_address,
450461
listen_port=istio_readiness_port, protocol='http', http_enabled="true")
@@ -473,6 +484,8 @@ def customizeManagedIstioNetworkAccessPoint(template, listen_address):
473484
model = env.getModel()
474485
if ssl is not None and 'Enabled' in ssl and ssl['Enabled'] == 'true':
475486
ssl_listen_port = ssl['ListenPort']
487+
if ssl_listen_port is None:
488+
ssl_listen_port = "7002"
476489
elif ssl is None and isSecureModeEnabledForDomain(model['topology']):
477490
ssl_listen_port = "7002"
478491

0 commit comments

Comments
 (0)