2
0
mirror of synced 2025-02-03 12:13:48 +00:00
2023-09-12 10:31:55 +02:00

31 lines
1.1 KiB
C#

using Logging;
using Utils;
namespace KubernetesWorkflow
{
public class WorkflowCreator
{
private readonly NumberSource numberSource = new NumberSource(0);
private readonly NumberSource containerNumberSource = new NumberSource(0);
private readonly KnownK8sPods knownPods = new KnownK8sPods();
private readonly K8sCluster cluster;
private readonly ILog log;
private readonly string testNamespace;
public WorkflowCreator(ILog log, Configuration configuration, string testNamespace)
{
cluster = new K8sCluster(configuration);
this.log = log;
this.testNamespace = testNamespace.ToLowerInvariant();
}
public IStartupWorkflow CreateWorkflow()
{
var workflowNumberSource = new WorkflowNumberSource(numberSource.GetNextNumber(),
containerNumberSource);
return new StartupWorkflow(log, workflowNumberSource, cluster, knownPods, testNamespace);
}
}
}