Two related error-contract problems in the SQL storage driver:
Get and Delete mapped *any* error from the release lookup to
ErrReleaseNotFound. A connection failure, a permission error or a
timeout was therefore indistinguishable from a release that genuinely
does not exist, and callers branch on that sentinel - a transient
database outage could be read as 'release absent'. Only sql.ErrNoRows
now maps to ErrReleaseNotFound; every other error is wrapped and
returned. Delete additionally left its transaction open on that path,
so it is now rolled back.
Create could never return ErrReleaseExists. After the insert fails the
transaction is in an aborted state, and PostgreSQL rejects every
subsequent statement on it, so the follow-up SELECT that decides
between 'already exists' and a genuine error always failed and the raw
driver error was surfaced instead. This diverges from the Secrets and
ConfigMaps drivers, which return ErrReleaseExists. The transaction is
now rolled back first and the existence check runs outside it.
Refs #32394 (items 2 and 3).
Signed-off-by: Mukul <nmukul32@gmail.com>