Files
mumble-kubernetes/test.sh
T
feedc0de cc39c5e9c2
Validate, publish and promote Mumble chart / chart (push) Successful in 33s
Validate and deploy Mumble / Deploy to Kubernetes (push) Successful in 21s
Validate and deploy Mumble / Validate manifests (push) Successful in 10s
Add versioned Mumble chart with optional PostgreSQL
2026-10-19 21:44:23 +02:00

34 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
sh -n install.sh bootstrap-homelab-secrets.sh scripts/chart-version.sh
helm repo add bitnami https://charts.bitnami.com/bitnami --force-update >/dev/null
helm dependency build chart/mumble >/dev/null
helm lint chart/mumble
helm lint chart/mumble --set postgresql.enabled=true
python3 - <<'PY'
import subprocess
import yaml
def render(*extra):
output = subprocess.check_output(['helm', 'template', 'mumble', 'chart/mumble',
'--namespace', 'default', '--set', 'postgresql.enabled=true',
*extra], text=True)
return [doc for doc in yaml.safe_load_all(output) if doc]
staged = render('--set', 'mumble.enabled=false')
assert not any(doc['kind'] == 'Deployment' for doc in staged)
assert any(doc['kind'] == 'StatefulSet' and doc['metadata']['name'] == 'mumble-postgresql' for doc in staged)
active = render()
deployment = next(doc for doc in active if doc['kind'] == 'Deployment' and doc['metadata']['name'] == 'mumble')
service = next(doc for doc in active if doc['kind'] == 'Service' and doc['metadata']['name'] == 'mumble')
assert not service['spec'].get('loadBalancerIP')
assert {port['protocol'] for port in service['spec']['ports']} == {'TCP', 'UDP'}
assert deployment['spec']['strategy']['type'] == 'Recreate'
pod = deployment['spec']['template']['spec']
assert [container['name'] for container in pod['initContainers']] == ['render-config']
assert pod['containers'][0]['image'].endswith('v1.5.939')
assert any(volume.get('secret', {}).get('secretName') == 'mumble-tls' for volume in pod['volumes'])
print('Mumble chart renders staged PostgreSQL and active Mumble without cleartext credentials.')
PY