Pod labels hook for containers deployed with CodexNetDeployer.
This commit is contained in:
parent
b8b59508aa
commit
e78659690b
|
@ -85,6 +85,8 @@ namespace CodexNetDeployer
|
||||||
retryDelay: TimeSpan.FromSeconds(3),
|
retryDelay: TimeSpan.FromSeconds(3),
|
||||||
kubernetesNamespace: config.KubeNamespace);
|
kubernetesNamespace: config.KubeNamespace);
|
||||||
|
|
||||||
|
configuration.Hooks = new K8sHook(config.TestsTypePodLabel);
|
||||||
|
|
||||||
return new EntryPoint(log, configuration, string.Empty);
|
return new EntryPoint(log, configuration, string.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue