Skip to content

Add in upgrade checks to prevent unsupport upgrade paths

DJ Mountney requested to merge implement-upgrade-check into master

Summary

Ensure the upgrade fails before database migrations are run on the new version.

Details

This MR adds a configmap that tracks the version, and adds an upgrade hook that is able to check that configmap during upgrade before its' been updated, giving us a chance to run the same upgrade checks we do in omnibus. (See here: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/config/templates/package-scripts/preinst.erb#L21)

Not having this configmap will block upgrades, so we need to add it in to our 1.9.x release. That is being done here: https://gitlab.com/charts/gitlab/merge_requests/829

Testing the change

Note that the checks exit early if your are on a branch/master appVersion, so in order to test you will want to be setting the global.gitlabVersion string.

If you first install this chart with that gitlabVersion set to 11.10.5, then try and upgrade to 12.0.0 you will see it fail. But if you instead install 11.11.3 it should work, then you should be able to install again using 12.0.0 and make it past the check. (The image pulls will fail though, because the 12.0.0 images have not been released)

You can also install an old release version of the chart that is missing the chart-info configmap, and upgrade to this one with global.gitlabVersion=12.0.0 and see it fail. I have https://gitlab.com/charts/gitlab/merge_requests/829 open so we can have at least one 1.9.x patch that will support the upgrade.

Fixes: https://gitlab.com/charts/gitlab/issues/1384

Edited by DJ Mountney

Merge request reports