Unknown runner location option.
This commit is contained in:
parent
ea66b5b408
commit
3e500e8346
@ -1,25 +1,25 @@
|
||||
using Logging;
|
||||
using System.Net.NetworkInformation;
|
||||
using Utils;
|
||||
|
||||
namespace KubernetesWorkflow
|
||||
{
|
||||
internal enum RunnerLocation
|
||||
{
|
||||
Unknown,
|
||||
ExternalToCluster,
|
||||
InternalToCluster,
|
||||
}
|
||||
|
||||
internal static class RunnerLocationUtils
|
||||
{
|
||||
private static RunnerLocation? knownLocation = null;
|
||||
private static RunnerLocation knownLocation = RunnerLocation.Unknown;
|
||||
|
||||
internal static RunnerLocation DetermineRunnerLocation(ILog log, PodInfo info, K8sCluster cluster)
|
||||
{
|
||||
if (knownLocation != null) return knownLocation.Value;
|
||||
if (knownLocation != RunnerLocation.Unknown) return knownLocation;
|
||||
knownLocation = PingForLocation(info, cluster);
|
||||
log.Log("Runner location set to: " + knownLocation);
|
||||
return knownLocation.Value;
|
||||
return knownLocation;
|
||||
}
|
||||
|
||||
private static RunnerLocation PingForLocation(PodInfo podInfo, K8sCluster cluster)
|
||||
|
@ -58,10 +58,14 @@ namespace KubernetesWorkflow
|
||||
{
|
||||
select = addresses.Single(a => a.IsInteral);
|
||||
}
|
||||
else
|
||||
else if (location == RunnerLocation.ExternalToCluster)
|
||||
{
|
||||
select = addresses.Single(a => !a.IsInteral);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Running location not known.");
|
||||
}
|
||||
|
||||
log.Log($"Container '{Name}' selected for tag '{portTag}' address: '{select}'");
|
||||
return select.Address;
|
||||
|
@ -27,7 +27,7 @@ namespace CodexNetDeployer
|
||||
public CodexNodeStartResult? Start(int i)
|
||||
{
|
||||
var name = GetCodexContainerName(i);
|
||||
Console.Write($" - {i} ({name})");
|
||||
Console.Write($" - {i} ({name})\t");
|
||||
Console.CursorLeft = 30;
|
||||
|
||||
ICodexNode? codexNode = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user