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

28 lines
1021 B
C#
Raw Normal View History

using Utils;
namespace KubernetesWorkflow
2023-04-12 11:53:55 +00:00
{
public class WorkflowCreator
{
private readonly NumberSource numberSource = new NumberSource(0);
private readonly NumberSource servicePortNumberSource = new NumberSource(30001);
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;
public WorkflowCreator(Configuration configuration)
{
cluster = new K8sCluster(configuration);
}
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(),
servicePortNumberSource,
containerNumberSource);
return new StartupWorkflow(workflowNumberSource, cluster, knownPods);
2023-04-12 11:53:55 +00:00
}
}
}