Skip to content

Add temporary preinst script to remove symlink directories

Balasankar 'Balu' C requested to merge add-preinst-remove-schema-files into master

What does this MR do?

Add a temporary preinst to remove the symlink related directories introduced by gitlab!79396 (merged) and gitlab!79815 (merged). Presence of these cause upgrades to fail.

To reproduce the bug, upgrade from 14.8.202202100320-12c522c58fa.888aeaaf0a5 to 14.8.202202100621-955dfb3691f.7c7e4759864. You will see something like the following

Unpacking gitlab-ee (14.8.202202100621-955dfb3691f.7c7e4759864) over (14.8.202202100320-12c522c58fa.888aeaaf0a5) ...
dpkg: error processing archive gitlab-ee_14.8.202202100621-955dfb3691f.7c7e4759864_amd64.deb (--install):
 unable to install new version of '/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ci/parsers/security/validators/schemas/14.0.0/container-scanning-report-format.json': No such file or directory

The former version has been installed across GitLab fleet, which means it is in a problematic state. So, if we are to manually fix this, we will have to manually delete the symlinks in all the nodes and then immediately do the upgrade. This preinst removes that requirement and automates it.

Related issues

gitlab-com/gl-infra/production#6325 (closed)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com
  • Pipeline is green on dev.gitlab.org if the change is touching anything besides documentation or internal cookbooks
  • trigger-package has a green pipeline running against latest commit

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Tests added
  • Integration tests added to GitLab QA
  • Equivalent MR/issue for the GitLab Chart opened
Edited by Balasankar 'Balu' C

Merge request reports