Skip to content

fix: preserve installation ID on helm upgrade - #74

Merged
sudopower merged 1 commit into
sudopower/pg-bouncer-chartfrom
fix/usage-stats-preserve-installation-id
Apr 7, 2026
Merged

sudopower merged 1 commit into
sudopower/pg-bouncer-chartfrom
fix/usage-stats-preserve-installation-id

Conversation

@sudopower

Copy link
Copy Markdown
Member

Problem

The pre-install,pre-upgrade hook was unconditionally calling uuidgen on every helm upgrade, causing two bugs:

  1. Installation ID overwritten — a new UUID replaced the existing installation_id in the secret, breaking continuity across upgrades
  2. Wrong event sent — a helm_install event fired on every upgrade (in addition to the correct helm_upgrade event from post-upgrade.yaml)

Fix

Move the existing secret lookup to the top of the hook script (before ID resolution), so:

  • On first install: secret doesn't exist → generate a new UUID
  • On upgrade: secret exists → reuse the stored installation_id
  • If global.usageStats.installationId is set in values: always use that (unchanged behaviour)

The secret lookup was already happening later in the script for the POST vs PATCH decision; this change hoists it up and removes the duplicate fetch.

The pre-install/pre-upgrade hook was unconditionally generating a new
UUID on every helm upgrade, overwriting the existing installation ID in
the secret and sending a spurious helm_install event. The fix reads the
existing secret upfront so the ID is reused on upgrades and only
generated fresh on first install.
@sudopower
sudopower changed the base branch from main to kiran/etl-782-introduce-pg-bouncer-in-helm-chart April 7, 2026 08:45
@sudopower
sudopower changed the base branch from kiran/etl-782-introduce-pg-bouncer-in-helm-chart to sudopower/pg-bouncer-chart April 7, 2026 09:22
@sudopower
sudopower requested a review from ashish-bagri April 7, 2026 09:27
@sudopower
sudopower merged commit 680517b into sudopower/pg-bouncer-chart Apr 7, 2026
1 check 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.

2 participants