2
0
mirror of synced 2025-01-27 00:39:32 +00:00

33 lines
1.2 KiB
C#
Raw Normal View History

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