Fixes issue where containers with no exposed ports cannot start.
This commit is contained in:
parent
4d654e106c
commit
9eae7cf25e
|
@ -98,7 +98,7 @@ namespace KubernetesWorkflow
|
|||
{
|
||||
var serviceName = "service-" + numberSource.WorkflowNumber;
|
||||
var namespaceName = cluster.Configuration.K8sNamespacePrefix + testNamespace;
|
||||
var port = recipe.ExposedPorts.First().Number;
|
||||
var port = GetInternalPort(recipe);
|
||||
|
||||
return new RunningContainerAddress(
|
||||
$"http://{serviceName}.{namespaceName}.svc.cluster.local",
|
||||
|
@ -111,6 +111,12 @@ namespace KubernetesWorkflow
|
|||
return 0;
|
||||
}
|
||||
|
||||
private static int GetInternalPort(ContainerRecipe recipe)
|
||||
{
|
||||
if (recipe.ExposedPorts.Any()) return recipe.ExposedPorts.First().Number;
|
||||
return 0;
|
||||
}
|
||||
|
||||
private ContainerRecipe[] CreateRecipes(int numberOfContainers, ContainerRecipeFactory recipeFactory, StartupConfig startupConfig)
|
||||
{
|
||||
log.Debug();
|
||||
|
|
Loading…
Reference in New Issue