2023-04-12 11:53:55 +00:00
|
|
|
|
using System.Globalization;
|
2023-04-12 13:11:36 +00:00
|
|
|
|
using Utils;
|
2023-04-12 11:53:55 +00:00
|
|
|
|
|
|
|
|
|
namespace KubernetesWorkflow
|
|
|
|
|
{
|
|
|
|
|
public class RecipeComponentFactory
|
|
|
|
|
{
|
|
|
|
|
private NumberSource portNumberSource = new NumberSource(8080);
|
|
|
|
|
|
|
|
|
|
public Port CreatePort()
|
|
|
|
|
{
|
|
|
|
|
return new Port(portNumberSource.GetNextNumber());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|