2023-04-12 13:53:55 +02:00
|
|
|
|
using System.Globalization;
|
2023-04-12 15:11:36 +02:00
|
|
|
|
using Utils;
|
2023-04-12 13:53:55 +02:00
|
|
|
|
|
|
|
|
|
namespace KubernetesWorkflow
|
|
|
|
|
{
|
|
|
|
|
public class RecipeComponentFactory
|
|
|
|
|
{
|
|
|
|
|
private NumberSource portNumberSource = new NumberSource(8080);
|
|
|
|
|
|
2023-04-13 14:36:17 +02:00
|
|
|
|
public Port CreatePort(string tag)
|
2023-04-12 13:53:55 +02:00
|
|
|
|
{
|
2023-04-13 14:36:17 +02:00
|
|
|
|
return new Port(portNumberSource.GetNextNumber(), tag);
|
2023-04-12 13:53:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public EnvVar CreateEnvVar(string name, int value)
|
|
|
|
|
{
|
|
|
|
|
return CreateEnvVar(name, value.ToString(CultureInfo.InvariantCulture));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public EnvVar CreateEnvVar(string name, string value)
|
|
|
|
|
{
|
|
|
|
|
return new EnvVar(name, value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|