Skip to content

deploy_monitoring.sh: exit non-zero when the monitoring Helm release is not deployed - #1430

Merged
dholt merged 1 commit into
masterfrom
dholt/monitoring-helm-exit
Oct 19, 2026
Merged

dholt merged 1 commit into
masterfrom
dholt/monitoring-helm-exit

Conversation

@dholt

@dholt dholt commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

The script returned 0 even when the kube-prometheus-stack Helm release ended up failed, and skipped the install whenever any release existed (including a failed one).

  • Exit non-zero with a clear message if helm upgrade --install fails.
  • Exit non-zero if the release is not in deployed state afterwards.
  • Install (retry) unless the release is already deployed.
  • Add scripts/validation/tests/test_deploy_monitoring.py, using stubbed helm/kubectl (no cluster needed).

Tested: python3 -m unittest discover scripts/validation/tests (136 tests OK).

…is not deployed

Fail when helm upgrade fails or the release ends up in any state other than
deployed, and retry a release left failed instead of skipping the install.
Add a stubbed-helm test.
@dholt
dholt requested a review from michael-balint October 19, 2026 21:57
STUB_LOG=self.log, STUB_STATE=self.state, **env)
r = subprocess.run(["bash", os.path.join(self.tmp, "scripts", "k8s", "deploy_monitoring.sh")],
cwd=self.tmp, env=e, capture_output=True, text=True, timeout=60)
calls = open(self.log).read() if os.path.exists(self.log) else ""
STUB_LOG=self.log, STUB_STATE=self.state, **env)
r = subprocess.run(["bash", os.path.join(self.tmp, "scripts", "k8s", "deploy_monitoring.sh")],
cwd=self.tmp, env=e, capture_output=True, text=True, timeout=60)
calls = open(self.log).read() if os.path.exists(self.log) else ""
@dholt
dholt merged commit fda2bca into master Oct 19, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants