Readies k8sCluster class for run against online cluster.
This commit is contained in:
parent
3d1d82f582
commit
3ecdce7b07
|
@ -91,7 +91,7 @@ namespace DistTestCore.Codex
|
|||
|
||||
private Http Http(TimeSpan? timeoutOverride = null)
|
||||
{
|
||||
var ip = Container.Pod.Cluster.IP;
|
||||
var ip = Container.Pod.Cluster.HostAddress;
|
||||
var port = Container.ServicePorts[0].Number;
|
||||
return new Http(log, timeSet, ip, port, baseUrl: "/api/codex/v1", timeoutOverride);
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ namespace DistTestCore.Codex
|
|||
AddExposedPortAndVar("API_PORT");
|
||||
AddEnvVar("DATA_DIR", $"datadir{ContainerNumber}");
|
||||
AddInternalPortAndVar("DISC_PORT", DiscoveryPortTag);
|
||||
AddEnvVar("LOG_LEVEL", config.LogLevel.ToString()!.ToUpperInvariant());
|
||||
|
||||
var listenPort = AddInternalPort();
|
||||
AddEnvVar("LISTEN_ADDRS", $"/ip4/0.0.0.0/tcp/{listenPort.Number}");
|
||||
|
@ -32,11 +33,6 @@ namespace DistTestCore.Codex
|
|||
{
|
||||
AddEnvVar("BOOTSTRAP_SPR", config.BootstrapSpr);
|
||||
}
|
||||
|
||||
if (config.LogLevel != null)
|
||||
{
|
||||
AddEnvVar("LOG_LEVEL", config.LogLevel.ToString()!.ToUpperInvariant());
|
||||
}
|
||||
if (config.StorageQuota != null)
|
||||
{
|
||||
AddEnvVar("STORAGE_QUOTA", config.StorageQuota.SizeInBytes.ToString()!);
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace DistTestCore.Marketplace
|
|||
|
||||
public NethereumInteraction StartInteraction(BaseLog log)
|
||||
{
|
||||
var ip = RunningContainers.RunningPod.Cluster.IP;
|
||||
var ip = RunningContainers.RunningPod.Cluster.HostAddress;
|
||||
var port = RunningContainers.Containers[0].ServicePorts[0].Number;
|
||||
var account = Account;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace DistTestCore.Marketplace
|
|||
|
||||
public NethereumInteraction StartInteraction(BaseLog log, GethAccount account)
|
||||
{
|
||||
var ip = RunningContainer.Pod.Cluster.IP;
|
||||
var ip = RunningContainer.Pod.Cluster.HostAddress;
|
||||
var port = RunningContainer.ServicePorts[0].Number;
|
||||
var privateKey = account.PrivateKey;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace DistTestCore.Metrics
|
|||
http = new Http(
|
||||
log,
|
||||
timeSet,
|
||||
runningContainers.RunningPod.Cluster.IP,
|
||||
runningContainers.RunningPod.Cluster.HostAddress,
|
||||
runningContainers.Containers[0].ServicePorts[0].Number,
|
||||
"api/v1");
|
||||
}
|
||||
|
|
|
@ -10,12 +10,12 @@ namespace KubernetesWorkflow
|
|||
}
|
||||
|
||||
public Configuration Configuration { get; }
|
||||
public string IP { get; private set; } = string.Empty;
|
||||
public string HostAddress { get; private set; } = string.Empty;
|
||||
|
||||
public KubernetesClientConfiguration GetK8sClientConfig()
|
||||
{
|
||||
var config = GetConfig();
|
||||
UpdateIp(config);
|
||||
UpdateHostAddress(config);
|
||||
return config;
|
||||
}
|
||||
|
||||
|
@ -47,10 +47,17 @@ namespace KubernetesWorkflow
|
|||
}
|
||||
}
|
||||
|
||||
private void UpdateIp(KubernetesClientConfiguration config)
|
||||
private void UpdateHostAddress(KubernetesClientConfiguration config)
|
||||
{
|
||||
var host = config.Host.Replace("https://", "");
|
||||
IP = host.Substring(0, host.IndexOf(':'));
|
||||
if (host.Contains(":"))
|
||||
{
|
||||
HostAddress = host.Substring(0, host.IndexOf(':'));
|
||||
}
|
||||
else
|
||||
{
|
||||
HostAddress = config.Host;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue