2023-06-28 13:11:20 +00:00
|
|
|
|
using DistTestCore.Codex;
|
|
|
|
|
using DistTestCore;
|
|
|
|
|
using Logging;
|
|
|
|
|
|
|
|
|
|
namespace ContinuousTests
|
|
|
|
|
{
|
|
|
|
|
public class K8sFactory
|
|
|
|
|
{
|
2023-08-11 06:39:51 +00:00
|
|
|
|
public TestLifecycle CreateTestLifecycle(string kubeConfigFile, string logPath, string dataFilePath, string customNamespace, ITimeSet timeSet, BaseLog log)
|
2023-06-28 13:11:20 +00:00
|
|
|
|
{
|
2023-06-29 08:45:29 +00:00
|
|
|
|
var kubeConfig = GetKubeConfig(kubeConfigFile);
|
2023-06-28 13:11:20 +00:00
|
|
|
|
var lifecycleConfig = new DistTestCore.Configuration
|
|
|
|
|
(
|
|
|
|
|
kubeConfigFile: kubeConfig,
|
2023-06-29 08:45:29 +00:00
|
|
|
|
logPath: logPath,
|
2023-06-28 13:11:20 +00:00
|
|
|
|
logDebug: false,
|
2023-06-29 08:45:29 +00:00
|
|
|
|
dataFilesPath: dataFilePath,
|
2023-06-28 13:11:20 +00:00
|
|
|
|
codexLogLevel: CodexLogLevel.Debug,
|
2023-08-10 08:58:18 +00:00
|
|
|
|
k8sNamespacePrefix: customNamespace
|
2023-06-28 13:11:20 +00:00
|
|
|
|
);
|
|
|
|
|
|
2023-08-10 11:58:50 +00:00
|
|
|
|
return new TestLifecycle(log, lifecycleConfig, timeSet, "continuous-tests", string.Empty);
|
2023-06-28 13:11:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static string? GetKubeConfig(string kubeConfigFile)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(kubeConfigFile) || kubeConfigFile.ToLowerInvariant() == "null") return null;
|
|
|
|
|
return kubeConfigFile;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|