Add missing get_kind_cluster function to helpers.py

Fixes ImportError in k8s_command.py that was causing CI failure.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
helm-charts-with-caddy
A. F. Dudley 2026-01-21 19:04:46 -05:00
parent 5a1399f2b2
commit d8da9b6515
1 changed files with 21 additions and 0 deletions

View File

@ -26,6 +26,27 @@ from stack_orchestrator.deploy.deploy_util import parsed_pod_files_map_from_file
from stack_orchestrator.deploy.deployer import DeployerException from stack_orchestrator.deploy.deployer import DeployerException
def get_kind_cluster():
"""Get an existing kind cluster, if any.
Uses `kind get clusters` to find existing clusters.
Returns the cluster name or None if no cluster exists.
"""
result = subprocess.run(
"kind get clusters",
shell=True,
capture_output=True,
text=True
)
if result.returncode != 0:
return None
clusters = result.stdout.strip().splitlines()
if clusters:
return clusters[0] # Return the first cluster found
return None
def _run_command(command: str): def _run_command(command: str):
if opts.o.debug: if opts.o.debug:
print(f"Running: {command}") print(f"Running: {command}")