mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-07-10 17:19:29 +00:00
fix: do not use anti affinity to enforce pod spread when running tests locally
Locally, there is only one node in the cluster, so the first pod would schedule on the node, then each subsequent pod would fail to schedule. This fix ensures that there is no spread affinity when the runner location is ExternalToCluster (local).
This commit is contained in:
parent
6bb176261f
commit
beb16f33d1
@ -423,8 +423,16 @@ namespace KubernetesWorkflow
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
private V1Affinity CreateSpreadAffinity()
|
||||
private V1Affinity? CreateSpreadAffinity()
|
||||
{
|
||||
// The required pod anti-affinity forces every pod in the namespace onto a
|
||||
// distinct node. That only makes sense on the multi-node GKE release cluster
|
||||
// (InternalToCluster). When running locally (ExternalToCluster, e.g. single-node
|
||||
// Docker Desktop) it would leave all but the first pod stuck Pending forever, so
|
||||
// we omit the affinity entirely in that case.
|
||||
if (RunnerLocationUtils.GetRunnerLocation() == RunnerLocation.ExternalToCluster)
|
||||
return null;
|
||||
|
||||
return new V1Affinity
|
||||
{
|
||||
PodAntiAffinity = new V1PodAntiAffinity
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user