@@ -585,19 +585,23 @@ def _set_container(self, namespace, container_name, data, **kwargs):
585585 data ["resources" ]["limits" ]["cpu" ] = cpu .lower ()
586586
587587 # add in healthchecks
588- healthchecks = kwargs .get ('healthcheck' , None )
589- if healthchecks and kwargs .get ('routable' , False ):
590- # check if a port is present. if not, auto-populate it
591- # TODO: rip this out when we stop supporting deis config:set HEALTHCHECK_URL
592- if (
593- healthchecks .get ('livenessProbe' ) is not None and
594- healthchecks ['livenessProbe' ].get ('httpGet' ) is not None and
595- healthchecks ['livenessProbe' ]['httpGet' ].get ('port' ) is None
596- ):
597- healthchecks ['livenessProbe' ]['httpGet' ]['port' ] = env ['PORT' ]
598- data .update (healthchecks )
599- else :
600- self ._default_readiness_probe (data , kwargs .get ('build_type' ), env .get ('PORT' , None ))
588+ self ._set_health_checks (data , env , kwargs )
589+
590+ def _set_health_checks (self , container , env , kwargs ):
591+ if kwargs .get ('routable' , False ):
592+ healthchecks = kwargs .get ('healthcheck' , None )
593+ if healthchecks :
594+ # check if a port is present. if not, auto-populate it
595+ # TODO: rip this out when we stop supporting deis config:set HEALTHCHECK_URL
596+ if (
597+ healthchecks .get ('livenessProbe' ) is not None and
598+ healthchecks ['livenessProbe' ].get ('httpGet' ) is not None and
599+ healthchecks ['livenessProbe' ]['httpGet' ].get ('port' ) is None
600+ ):
601+ healthchecks ['livenessProbe' ]['httpGet' ]['port' ] = env ['PORT' ]
602+ container .update (healthchecks )
603+ else :
604+ self ._default_readiness_probe (container , kwargs .get ('build_type' ), env .get ('PORT' , None )) # noqa
601605
602606 def _get_private_registry_config (self , registry , image ):
603607 secret_name = settings .REGISTRY_SECRET_PREFIX
0 commit comments