cs-codex-dist-tests/KubernetesWorkflow/WorkflowCreator.cs

31 lines
1.0 KiB
C#
Raw Normal View History

2023-04-25 09:31:15 +00:00
using Logging;
using Utils;
namespace KubernetesWorkflow
2023-04-12 11:53:55 +00:00
{
public class WorkflowCreator
{
private readonly NumberSource numberSource = new NumberSource(0);
2023-04-13 09:07:36 +00:00
private readonly NumberSource containerNumberSource = new NumberSource(0);
private readonly KnownK8sPods knownPods = new KnownK8sPods();
private readonly K8sCluster cluster;
2023-04-25 09:31:15 +00:00
private readonly BaseLog log;
private readonly string testNamespace;
2023-04-25 09:31:15 +00:00
public WorkflowCreator(BaseLog log, Configuration configuration)
{
cluster = new K8sCluster(configuration);
2023-04-25 09:31:15 +00:00
this.log = log;
testNamespace = Guid.NewGuid().ToString().ToLowerInvariant();
}
2023-04-12 11:53:55 +00:00
public StartupWorkflow CreateWorkflow()
{
2023-04-13 09:07:36 +00:00
var workflowNumberSource = new WorkflowNumberSource(numberSource.GetNextNumber(),
containerNumberSource);
return new StartupWorkflow(log, workflowNumberSource, cluster, knownPods, testNamespace);
2023-04-12 11:53:55 +00:00
}
}
}