Look in more directories for upgrade binaries#4304
Conversation
cdbdad4 to
9ecc14d
Compare
| // - https://cwrap.org/nss_wrapper.html | ||
| `export LD_PRELOAD='libnss_wrapper.so' NSS_WRAPPER_GROUP NSS_WRAPPER_PASSWD`, | ||
|
|
||
| // Find directories that contain the desired Postgres executables. |
There was a problem hiding this comment.
Maybe describe what is going on here a little more.
My understanding is that the postgres.ShellPath stuff sets the path variable and the command -v postgres/initdb returns the full path to the binary
There was a problem hiding this comment.
👍🏻 I've added some description.
That made me realize the PATH built into the image is also searched, so any ol' postgres might be found. I added an assertion* on the --version returned by something in old_bin and new_bin, and learned and doc'd that pg_upgrade does a similar check only recently-ish.
* same check as the postgres init container:
postgres-operator/internal/postgres/config.go
Lines 489 to 491 in e395e2a
|
With this change do we need the postgres bins on the |
This leaves the disk untouched when the upgrade image cannot support the requested upgrade. Issue: PGO-300 See: 406e069
9ecc14d to
4eae062
Compare
I find this Go code and resulting Bash easier to read. This also logs more about what is happening without changing the sequence of commands. The script included an unnecessary `|| exit`, so I moved the `set -eu` out of the Bash invocation into the script itself to make that behavior more obvious.
This makes major upgrades compatible with images from other distros. Issue: PGO-864
4eae062 to
be40084
Compare
|
Checklist:
Type of Changes:
What is the current behavior (link to any open issues here)?
Images for major upgrades must have binaries at Red Hat paths.
What is the new behavior (if this is a feature change)?
Major upgrades look for binaries in typical paths for multiple distro flavors: Alpine, Debian, Red Hat.
Other Information:
Issue: PGO-864