Bumps k8s operation timeout for continuous test runner.
This commit is contained in:
parent
3f2c789dd5
commit
562f886e30
|
@ -32,7 +32,7 @@ namespace KubernetesWorkflow
|
||||||
public RunningPod BringOnline(ContainerRecipe[] containerRecipes, ILocation location)
|
public RunningPod BringOnline(ContainerRecipe[] containerRecipes, ILocation location)
|
||||||
{
|
{
|
||||||
log.Debug();
|
log.Debug();
|
||||||
EnsureTestNamespace();
|
EnsureNamespace();
|
||||||
|
|
||||||
var deploymentName = CreateDeployment(containerRecipes, location);
|
var deploymentName = CreateDeployment(containerRecipes, location);
|
||||||
var (serviceName, servicePortsMap) = CreateService(containerRecipes);
|
var (serviceName, servicePortsMap) = CreateService(containerRecipes);
|
||||||
|
@ -90,7 +90,7 @@ namespace KubernetesWorkflow
|
||||||
public void DeleteNamespace()
|
public void DeleteNamespace()
|
||||||
{
|
{
|
||||||
log.Debug();
|
log.Debug();
|
||||||
if (IsTestNamespaceOnline())
|
if (IsNamespaceOnline(K8sNamespace))
|
||||||
{
|
{
|
||||||
client.Run(c => c.DeleteNamespace(K8sNamespace, null, null, gracePeriodSeconds: 0));
|
client.Run(c => c.DeleteNamespace(K8sNamespace, null, null, gracePeriodSeconds: 0));
|
||||||
}
|
}
|
||||||
|
@ -134,9 +134,9 @@ namespace KubernetesWorkflow
|
||||||
|
|
||||||
private string K8sNamespace { get; }
|
private string K8sNamespace { get; }
|
||||||
|
|
||||||
private void EnsureTestNamespace()
|
private void EnsureNamespace()
|
||||||
{
|
{
|
||||||
if (IsTestNamespaceOnline()) return;
|
if (IsNamespaceOnline(K8sNamespace)) return;
|
||||||
|
|
||||||
var namespaceSpec = new V1Namespace
|
var namespaceSpec = new V1Namespace
|
||||||
{
|
{
|
||||||
|
@ -153,11 +153,6 @@ namespace KubernetesWorkflow
|
||||||
CreatePolicy();
|
CreatePolicy();
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool IsTestNamespaceOnline()
|
|
||||||
{
|
|
||||||
return IsNamespaceOnline(K8sNamespace);
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool IsNamespaceOnline(string name)
|
private bool IsNamespaceOnline(string name)
|
||||||
{
|
{
|
||||||
return client.Run(c => c.ListNamespace().Items.Any(n => n.Metadata.Name == name));
|
return client.Run(c => c.ListNamespace().Items.Any(n => n.Metadata.Name == name));
|
||||||
|
|
|
@ -19,8 +19,8 @@ namespace ContinuousTests
|
||||||
var lifecycleConfig = new KubernetesWorkflow.Configuration
|
var lifecycleConfig = new KubernetesWorkflow.Configuration
|
||||||
(
|
(
|
||||||
kubeConfigFile: kubeConfig,
|
kubeConfigFile: kubeConfig,
|
||||||
operationTimeout: TimeSpan.FromSeconds(30),
|
operationTimeout: TimeSpan.FromMinutes(2),
|
||||||
retryDelay: TimeSpan.FromSeconds(10),
|
retryDelay: TimeSpan.FromSeconds(30),
|
||||||
kubernetesNamespace: customNamespace
|
kubernetesNamespace: customNamespace
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue