2
0
mirror of synced 2025-01-10 08:36:13 +00:00
cs-codex-dist-tests/ProjectPlugins/CodexPlugin/CoreInterfaceExtensions.cs
2024-04-13 17:12:14 +03:00

47 lines
1.4 KiB
C#

using Core;
using KubernetesWorkflow.Types;
namespace CodexPlugin
{
public static class CoreInterfaceExtensions
{
public static RunningPod[] DeployCodexNodes(this CoreInterface ci, int number, Action<ICodexSetup> setup)
{
return Plugin(ci).DeployCodexNodes(number, setup);
}
public static ICodexNodeGroup WrapCodexContainers(this CoreInterface ci, RunningPod[] containers)
{
return Plugin(ci).WrapCodexContainers(ci, containers);
}
public static ICodexNode StartCodexNode(this CoreInterface ci)
{
return ci.StartCodexNodes(1)[0];
}
public static ICodexNode StartCodexNode(this CoreInterface ci, Action<ICodexSetup> setup)
{
return ci.StartCodexNodes(1, setup)[0];
}
public static ICodexNodeGroup StartCodexNodes(this CoreInterface ci, int number, Action<ICodexSetup> setup)
{
var rc = ci.DeployCodexNodes(number, setup);
var result = ci.WrapCodexContainers(rc);
Plugin(ci).WireUpMarketplace(result, setup);
return result;
}
public static ICodexNodeGroup StartCodexNodes(this CoreInterface ci, int number)
{
return ci.StartCodexNodes(number, s => { });
}
private static CodexPlugin Plugin(CoreInterface ci)
{
return ci.GetPlugin<CodexPlugin>();
}
}
}