Interview Prep/Helm/Hooks, Migrations & Testing

A `post-install` hook seeds demo data; it ran again on every upgrade and duplicated rows. Why?

IntermediateScenarioHooks, Migrations & Testing
Answer

Situation read → The hook annotation probably lists post-install,post-upgrade, or the seed is not idempotent.

What I'd do →

  1. Restrict to post-install if seeding is a one-time action.
  2. Make the seed idempotent (INSERT ... ON CONFLICT DO NOTHING).
  3. Note: under Argo CD, post-install maps to PostSync, which runs on every sync, so idempotency is mandatory there.

Why → Hooks can run more often than you expect; design them to be safe on repeat.

Interview tip → Mention the Argo CD mapping.

All Helm questions Roadmap: Helm

More on Hooks, Migrations & Testing