Removes application-level managed namespaces. Use GUIDs instead.
This commit is contained in:
parent
8ba4b1a290
commit
303eb99f49
|
@ -1,34 +0,0 @@
|
|||
using Utils;
|
||||
|
||||
namespace KubernetesWorkflow
|
||||
{
|
||||
public class ApplicationLifecycle
|
||||
{
|
||||
private static object instanceLock = new object();
|
||||
private static ApplicationLifecycle? instance;
|
||||
private readonly NumberSource namespaceNumberSource = new NumberSource(0);
|
||||
|
||||
private ApplicationLifecycle()
|
||||
{
|
||||
}
|
||||
|
||||
public static ApplicationLifecycle Instance
|
||||
{
|
||||
// I know singletons are quite evil. But we need to be sure this object is created only once
|
||||
// and persists for the entire application lifecycle.
|
||||
get
|
||||
{
|
||||
lock (instanceLock)
|
||||
{
|
||||
if (instance == null) instance = new ApplicationLifecycle();
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string GetTestNamespace()
|
||||
{
|
||||
return namespaceNumberSource.GetNextNumber().ToString("D5");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,7 +16,7 @@ namespace KubernetesWorkflow
|
|||
{
|
||||
cluster = new K8sCluster(configuration);
|
||||
this.log = log;
|
||||
testNamespace = ApplicationLifecycle.Instance.GetTestNamespace();
|
||||
testNamespace = Guid.NewGuid().ToString().ToLowerInvariant();
|
||||
}
|
||||
|
||||
public StartupWorkflow CreateWorkflow()
|
||||
|
|
Loading…
Reference in New Issue