diff --git a/Tools/CodexNetDeployer/Deployer.cs b/Tools/CodexNetDeployer/Deployer.cs index 1b16dcf..958df70 100644 --- a/Tools/CodexNetDeployer/Deployer.cs +++ b/Tools/CodexNetDeployer/Deployer.cs @@ -85,6 +85,8 @@ namespace CodexNetDeployer retryDelay: TimeSpan.FromSeconds(3), kubernetesNamespace: config.KubeNamespace); + configuration.Hooks = new K8sHook(config.TestsTypePodLabel); + return new EntryPoint(log, configuration, string.Empty); } diff --git a/Tools/CodexNetDeployer/K8sHook.cs b/Tools/CodexNetDeployer/K8sHook.cs new file mode 100644 index 0000000..b81078f --- /dev/null +++ b/Tools/CodexNetDeployer/K8sHook.cs @@ -0,0 +1,30 @@ +using DistTestCore; +using KubernetesWorkflow; + +namespace CodexNetDeployer +{ + public class K8sHook : IK8sHooks + { + private readonly string testsTypeLabel; + + public K8sHook(string testsTypeLabel) + { + this.testsTypeLabel = testsTypeLabel; + } + + public void OnContainersStarted(RunningContainers rc) + { + } + + public void OnContainersStopped(RunningContainers rc) + { + } + + public void OnContainerRecipeCreated(ContainerRecipe recipe) + { + recipe.PodLabels.Add("tests-type", testsTypeLabel); + recipe.PodLabels.Add("runid", NameUtils.GetRunId()); + recipe.PodLabels.Add("testid", NameUtils.GetTestId()); + } + } +}