2023-04-12 13:53:55 +02:00
|
|
|
|
namespace KubernetesWorkflow
|
|
|
|
|
{
|
|
|
|
|
public class StartupConfig
|
|
|
|
|
{
|
|
|
|
|
private readonly List<object> configs = new List<object>();
|
|
|
|
|
|
2023-04-30 10:56:19 +02:00
|
|
|
|
public string? NameOverride { get; set; }
|
2023-09-11 16:57:57 +02:00
|
|
|
|
public bool CreateCrashWatcher { get; set; }
|
2023-04-30 10:56:19 +02:00
|
|
|
|
|
2023-04-12 13:53:55 +02:00
|
|
|
|
public void Add(object config)
|
|
|
|
|
{
|
|
|
|
|
configs.Add(config);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public T Get<T>()
|
|
|
|
|
{
|
2023-04-12 16:12:04 +02:00
|
|
|
|
var match = configs.Single(c => typeof(T).IsAssignableFrom(c.GetType()));
|
2023-04-12 13:53:55 +02:00
|
|
|
|
return (T)match;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|