@@ -395,7 +395,7 @@ def deploy(self, namespace, name, image, command, **kwargs):
395395 # traffic to the application
396396 self ._update_application_service (namespace , name , app_type , image , routable )
397397
398- def _update_application_service (self , namespace , name , app_type , image , routable ):
398+ def _update_application_service (self , namespace , name , app_type , image , routable = False ):
399399 """Update application service with all the various required information"""
400400 try :
401401 # Fetch service
@@ -411,11 +411,12 @@ def _update_application_service(self, namespace, name, app_type, image, routable
411411 service ['spec' ]['selector' ]['type' ] = app_type
412412
413413 # Find if target port exists already, update / create as required
414- port = self ._get_port (image )
415- for pos , item in enumerate (service ['spec' ]['ports' ]):
416- if item ['port' ] == 80 and port != item ['targetPort' ]:
417- # port 80 is the only one we care about right now
418- service ['spec' ]['ports' ][pos ]['targetPort' ] = port
414+ if routable :
415+ port = self ._get_port (image )
416+ for pos , item in enumerate (service ['spec' ]['ports' ]):
417+ if item ['port' ] == 80 and port != item ['targetPort' ]:
418+ # port 80 is the only one we care about right now
419+ service ['spec' ]['ports' ][pos ]['targetPort' ] = port
419420
420421 self ._update_service (namespace , namespace , data = service )
421422 except Exception as e :
0 commit comments