Skip to content

Feat/get configuration action#609

Open
minulo wants to merge 3 commits into
mainfrom
feat/get-configuration-action
Open

Feat/get configuration action#609
minulo wants to merge 3 commits into
mainfrom
feat/get-configuration-action

Conversation

@minulo

@minulo minulo commented Jul 17, 2026

Copy link
Copy Markdown

What this PR does

Add a get-configuration Juju action so operators can inspect the effective haproxy configuration for debugging without shell access to the unit.

  • source=disk (default): return the applied /etc/haproxy/haproxy.cfg
  • source=relations: preview the configuration the next reconcile would generate from the current haproxy-route relation data (read-only; no file writes or service reload)
  • Log a warning when the effective configuration matches the default (no proxy backends configured) and, in relations mode, when a haproxy-route-policy relation makes the policy backend converge asynchronously (source=disk may also face the async issue if run before the haproxy-route-policy get written to file)
  • Refactored shared template-context and render-to-string helpers so the reconcile and preview paths cannot drift

Why we need it

The haproxy charm creates configuration based on its haproxy-route, haproxy-route-policy, and haproxy-route-tcp relations, but there is no way to inspect the effective configuration without shell access to the unit. This spec proposes a get-configuration Juju Action that returns the charm’s configuration out to stdout by both reading from disk and calculating the potential resulting configuration based on current relations.

Checklist

  • [ x] I followed the contributing guide
  • I added or updated the documentation (if applicable)
  • I updated docs/changelog.md with user-relevant changes
  • I added a change artifact for user-relevant changes in docs/release-notes/artifacts. If no change artifact is necessary, I tagged the PR with the label no-release-note.
  • [ x] I used AI to assist with preparing this PR
  • [ x] I added or updated tests as needed (unit and integration)

minulo added 2 commits July 17, 2026 02:37
Add a get-configuration Juju action so operators can inspect the effective
haproxy configuration for debugging without shell access to the unit.

- source=disk (default): return the applied /etc/haproxy/haproxy.cfg
- source=relations: preview the configuration the next reconcile would
  generate from the current haproxy-route relation data (read-only; no
  file writes or service reload)
- Log a warning when the effective configuration matches the default
  (no proxy backends configured) and, in relations mode, when a
  haproxy-route-policy relation makes the policy backend converge
  asynchronously (source=disk stays authoritative)
- Extract shared template-context and render-to-string helpers so the
  reconcile and preview paths cannot drift

AI-assisted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant