Skip to content

Commit 5fc9032

Browse files
committed
Error out if helm version is less than v4
1 parent f1c60b4 commit 5fc9032

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

deployer/infra_components/cluster.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import sys
34
import json
45
import os
56
import subprocess
@@ -72,6 +73,11 @@ def auth(self, silent=False):
7273
raise ValueError(f"Provider {self.spec['provider']} not supported")
7374

7475
def deploy_support(self, cert_manager_version, debug, dry_run):
76+
helm_version = subprocess.check_output(["helm", "version", "--short"]).decode().strip()
77+
if not helm_version.startswith("v4."):
78+
print(f"Minimum required version of helm is v4. Found version {helm_version}", file=sys.stderr)
79+
print(f"Upgrade your version of helm and try again")
80+
sys.exit(1)
7581
cert_manager_url = "https://charts.jetstack.io"
7682

7783
print_colour("Provisioning cert-manager...")

deployer/infra_components/hub.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import subprocess
55
from contextlib import ExitStack
66
from pathlib import Path
7+
import sys
78
from typing import TYPE_CHECKING
89

910
from ruamel.yaml import YAML
@@ -95,6 +96,12 @@ def deploy(self, chart_dir, dask_gateway_version, debug, dry_run):
9596
"""
9697
Deploy this hub
9798
"""
99+
# Make sure we're on helm v4
100+
helm_version = subprocess.check_output(["helm", "version", "--short"]).decode().strip()
101+
if not helm_version.startswith("v4."):
102+
print(f"Minimum required version of helm is v4. Found version {helm_version}", file=sys.stderr)
103+
print(f"Upgrade your version of helm and try again")
104+
sys.exit(1)
98105
# Support overriding domain configuration in the loaded cluster.yaml via
99106
# a cluster.yaml specified enc-<something>.secret.yaml file that only
100107
# includes the domain configuration of a typical cluster.yaml file.

0 commit comments

Comments
 (0)