Attempt internal connection using pod IP and exposed port.
This commit is contained in:
parent
b92c1b970d
commit
61d2185bb6
|
@ -82,7 +82,7 @@ namespace KubernetesWorkflow
|
|||
|
||||
return new RunningContainer(runningPod, r, servicePorts, startupConfig,
|
||||
GetContainerExternalAddress(runningPod, servicePorts),
|
||||
GetContainerInternalAddress(servicePorts));
|
||||
GetContainerInternalAddress(runningPod, r, servicePorts));
|
||||
|
||||
}).ToArray();
|
||||
}
|
||||
|
@ -94,14 +94,17 @@ namespace KubernetesWorkflow
|
|||
GetServicePort(servicePorts));
|
||||
}
|
||||
|
||||
private RunningContainerAddress GetContainerInternalAddress(Port[] servicePorts)
|
||||
private RunningContainerAddress GetContainerInternalAddress(RunningPod pod, ContainerRecipe recipe, Port[] servicePorts)
|
||||
{
|
||||
var serviceName = "service-" + numberSource.WorkflowNumber;
|
||||
var namespaceName = cluster.Configuration.K8sNamespacePrefix + testNamespace;
|
||||
var ip = pod.Ip;
|
||||
var port = recipe.ExposedPorts.First().Number;
|
||||
//var serviceName = "service-" + numberSource.WorkflowNumber;
|
||||
//var namespaceName = cluster.Configuration.K8sNamespacePrefix + testNamespace;
|
||||
|
||||
return new RunningContainerAddress(
|
||||
$"http://{serviceName}.{namespaceName}.svc.cluster.local",
|
||||
GetServicePort(servicePorts));
|
||||
//$"http://{serviceName}.{namespaceName}.svc.cluster.local",
|
||||
$"http://{ip}",
|
||||
port);
|
||||
}
|
||||
|
||||
private static int GetServicePort(Port[] servicePorts)
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using DistTestCore;
|
||||
using DistTestCore.Codex;
|
||||
using DistTestCore.Helpers;
|
||||
using NUnit.Framework;
|
||||
using Utils;
|
||||
|
|
Loading…
Reference in New Issue