Skip to content

Commit ba90177

Browse files
Pin dask-gateway version for tests on older Kubernetes versions (#939)
1 parent 883f889 commit ba90177

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dask_kubernetes/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
import uuid
99
from typing import Final, Iterator
1010

11+
import kr8s
1112
import pytest
1213
from kopf.testing import KopfRunner
14+
from packaging.version import Version
1315
from pytest_kind.cluster import KindCluster
1416

1517
DIR: Final[pathlib.Path] = pathlib.Path(__file__).parent.absolute()
@@ -105,6 +107,7 @@ def namespace(k8s_cluster: KindCluster) -> Iterator[str]:
105107

106108
@pytest.fixture(scope="session", autouse=True)
107109
def install_gateway(k8s_cluster: KindCluster) -> Iterator[None]:
110+
kube_version = Version(kr8s.version().get("gitVersion"))
108111
if bool(os.environ.get("TEST_DASK_GATEWAY", False)):
109112
check_dependency("helm")
110113
# To ensure the operator can coexist with Gateway
@@ -115,6 +118,8 @@ def install_gateway(k8s_cluster: KindCluster) -> Iterator[None]:
115118
"dask-gateway",
116119
"dask-gateway",
117120
"--install",
121+
"--version",
122+
"2024.1.0" if kube_version < Version("1.30.0") else ">=2024.1.0",
118123
"--repo=https://helm.dask.org",
119124
"--create-namespace",
120125
"--namespace",

0 commit comments

Comments
 (0)