diff --git a/Framework/KubernetesWorkflow/StartupWorkflow.cs b/Framework/KubernetesWorkflow/StartupWorkflow.cs index c8635d4..0d29284 100644 --- a/Framework/KubernetesWorkflow/StartupWorkflow.cs +++ b/Framework/KubernetesWorkflow/StartupWorkflow.cs @@ -145,7 +145,7 @@ namespace KubernetesWorkflow result.Add(new ContainerPort( exposedPort, GetContainerExternalAddress(pod, servicePorts, exposedPort), - GetContainerInternalAddress(exposedPort))); + GetContainerInternalAddress(pod, exposedPort))); } foreach (var internalPort in recipe.InternalPorts) { @@ -154,7 +154,7 @@ namespace KubernetesWorkflow result.Add(new ContainerPort( internalPort, new Address(string.Empty, 0), - GetContainerInternalAddress(internalPort))); + GetContainerInternalAddress(pod, internalPort))); } } @@ -170,12 +170,15 @@ namespace KubernetesWorkflow servicePort.Number); } - private Address GetContainerInternalAddress(Port port) + private Address GetContainerInternalAddress(RunningPod pod, Port port) { - var serviceName = "service-" + numberSource.WorkflowNumber; + //var serviceName = "service-" + numberSource.WorkflowNumber; + //return new Address( + // $"http://{serviceName}.{k8sNamespace}.svc.cluster.local", + // port.Number); return new Address( - $"http://{serviceName}.{k8sNamespace}.svc.cluster.local", + $"http://{pod.PodInfo.Ip}", port.Number); } diff --git a/ProjectPlugins/CodexContractsPlugin/CodexContractsContainerRecipe.cs b/ProjectPlugins/CodexContractsPlugin/CodexContractsContainerRecipe.cs index 3a5dd3b..36ca448 100644 --- a/ProjectPlugins/CodexContractsPlugin/CodexContractsContainerRecipe.cs +++ b/ProjectPlugins/CodexContractsPlugin/CodexContractsContainerRecipe.cs @@ -17,12 +17,9 @@ namespace CodexContractsPlugin { var config = startupConfig.Get(); - var containerPort = config.GethNode.StartResult.Container.GetContainerPort(GethContainerRecipe.HttpPortTag); + var address = config.GethNode.StartResult.Container.GetAddress(GethContainerRecipe.HttpPortTag); - var ip = config.GethNode.StartResult.Container.Pod.PodInfo.Ip; - var port = containerPort.InternalAddress.Port; - - AddEnvVar("DISTTEST_NETWORK_URL", $"http://{ip}:{port}"); + AddEnvVar("DISTTEST_NETWORK_URL", address.ToString()); AddEnvVar("HARDHAT_NETWORK", "codexdisttestnetwork"); AddEnvVar("KEEP_ALIVE", "1"); }